mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
Add ineligible status on domain application, on user. Trigger fsm transition on domain application which triggers status ineligible on user. Edit permissions on domains and newly created application wizard perm class to block access to ineligible users. Run migrations.
This commit is contained in:
parent
87bb71a214
commit
c98392baac
9 changed files with 236 additions and 7 deletions
|
@ -98,6 +98,15 @@ class MyUserAdmin(BaseUserAdmin):
|
|||
"""Custom user admin class to use our inlines."""
|
||||
|
||||
inlines = [UserContactInline]
|
||||
|
||||
list_display = ("email", "first_name", "last_name", "is_staff", "is_superuser", "status")
|
||||
|
||||
fieldsets = (
|
||||
(None, {'fields': ('username', 'password', 'status')}), # Add the 'status' field here
|
||||
('Personal Info', {'fields': ('first_name', 'last_name', 'email')}),
|
||||
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions')}),
|
||||
('Important dates', {'fields': ('last_login', 'date_joined')}),
|
||||
)
|
||||
|
||||
def get_list_display(self, request):
|
||||
if not request.user.is_superuser:
|
||||
|
@ -295,6 +304,9 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
elif obj.status == models.DomainApplication.REJECTED:
|
||||
obj.status = original_obj.status
|
||||
obj.reject()
|
||||
elif obj.status == models.DomainApplication.INELIGIBLE:
|
||||
obj.status = original_obj.status
|
||||
obj.reject_with_prejudice()
|
||||
else:
|
||||
logger.warning("Unknown status selected in django admin")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue