Merge pull request #1718 from cisagov/rjm/1674-approved-inreview-approved

Issue 1674: Add FSM rules for the new transitions from approv
This commit is contained in:
rachidatecs 2024-02-07 14:08:27 -05:00 committed by GitHub
commit 5faa438956
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 118 additions and 140 deletions

View file

@ -884,14 +884,11 @@ class DomainApplicationAdmin(ListHeaderAdmin):
if (
obj
and original_obj.status == models.DomainApplication.ApplicationStatus.APPROVED
and (
obj.status == models.DomainApplication.ApplicationStatus.REJECTED
or obj.status == models.DomainApplication.ApplicationStatus.INELIGIBLE
)
and obj.status != models.DomainApplication.ApplicationStatus.APPROVED
and not obj.domain_is_not_active()
):
# If an admin tried to set an approved application to
# rejected or ineligible and the related domain is already
# another status and the related domain is already
# active, shortcut the action and throw a friendly
# error message. This action would still not go through
# shortcut or not as the rules are duplicated on the model,