mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 10:59:21 +02:00
Fix verification type
This commit is contained in:
parent
5cba82b343
commit
3e7f143a1e
5 changed files with 53 additions and 15 deletions
|
@ -508,7 +508,7 @@ class MyUserAdmin(BaseUserAdmin):
|
|||
("Important dates", {"fields": ("last_login", "date_joined")}),
|
||||
)
|
||||
|
||||
readonly_fields = ("verification_type")
|
||||
readonly_fields = ("verification_type",)
|
||||
|
||||
# Hide Username (uuid), Groups and Permissions
|
||||
# Q: Now that we're using Groups and Permissions,
|
||||
|
@ -516,7 +516,7 @@ class MyUserAdmin(BaseUserAdmin):
|
|||
analyst_fieldsets = (
|
||||
(
|
||||
None,
|
||||
{"fields": ("password", "status")},
|
||||
{"fields": ("password", "status", "verification_type")},
|
||||
),
|
||||
("Personal Info", {"fields": ("first_name", "last_name", "email")}),
|
||||
(
|
||||
|
@ -636,11 +636,14 @@ class MyUserAdmin(BaseUserAdmin):
|
|||
return []
|
||||
|
||||
def get_readonly_fields(self, request, obj=None):
|
||||
readonly_fields = list(self.readonly_fields)
|
||||
|
||||
if request.user.has_perm("registrar.full_access_permission"):
|
||||
return () # No read-only fields for all access users
|
||||
# Return restrictive Read-only fields for analysts and
|
||||
# users who might not belong to groups
|
||||
return self.analyst_readonly_fields
|
||||
return readonly_fields
|
||||
else:
|
||||
# Return restrictive Read-only fields for analysts and
|
||||
# users who might not belong to groups
|
||||
return self.analyst_readonly_fields
|
||||
|
||||
|
||||
class HostIPInline(admin.StackedInline):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue