mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 18:56:15 +02:00
fix 500 error message when managing domain w/o information and application
This commit is contained in:
parent
e9a1eb42fb
commit
70faa6beb9
1 changed files with 9 additions and 1 deletions
|
@ -100,7 +100,15 @@ class DomainPermission(PermissionsLoginMixin):
|
|||
if DomainInformation.objects.filter(id=pk).exists():
|
||||
requested_domain = DomainInformation.objects.get(id=pk)
|
||||
|
||||
if requested_domain.domain_application.status not in valid_domain_statuses:
|
||||
# if no domain information or domain application exist, the user
|
||||
# should be able to manage the domain; however, if domain information
|
||||
# and domain application exist, and application is not in valid status,
|
||||
# user should not be able to manage domain
|
||||
if (
|
||||
requested_domain
|
||||
and requested_domain.domain_application
|
||||
and requested_domain.domain_application.status not in valid_domain_statuses
|
||||
):
|
||||
return False
|
||||
|
||||
# Valid session keys exist,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue