fix 500 error message when managing domain w/o information and application

This commit is contained in:
David Kennedy 2023-11-03 10:16:10 -04:00
parent e9a1eb42fb
commit 70faa6beb9
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -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,