Revert change where only status change is forbidden

This commit is contained in:
zandercymatics 2024-03-07 10:42:30 -07:00
parent 6f15428abd
commit 9dec0753f2
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -134,6 +134,9 @@ class DomainApplicationAdminForm(forms.ModelForm):
status = cleaned_data.get("status")
investigator = cleaned_data.get("investigator")
# Get the old status
initial_status = self.initial.get("status", None)
# We only care about investigator when in these statuses
checked_statuses = [
DomainApplication.ApplicationStatus.APPROVED,
@ -144,7 +147,7 @@ class DomainApplicationAdminForm(forms.ModelForm):
]
# If a status change occured, check for validity
if status in checked_statuses:
if status != initial_status and status in checked_statuses:
# Checks the "investigators" field for validity.
# That field must obey certain conditions when an application is approved.
# Will call "add_error" if any issues are found.