mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 18:56:15 +02:00
Update admin.py
This commit is contained in:
parent
4be6979af5
commit
d0b252b354
1 changed files with 2 additions and 1 deletions
|
@ -133,6 +133,7 @@ class DomainRequestAdminForm(forms.ModelForm):
|
||||||
cleaned_data = super().clean()
|
cleaned_data = super().clean()
|
||||||
status = cleaned_data.get("status")
|
status = cleaned_data.get("status")
|
||||||
investigator = cleaned_data.get("investigator")
|
investigator = cleaned_data.get("investigator")
|
||||||
|
rejection_reason = cleaned_data.get("rejection_reason")
|
||||||
|
|
||||||
# Get the old status
|
# Get the old status
|
||||||
initial_status = self.initial.get("status", None)
|
initial_status = self.initial.get("status", None)
|
||||||
|
@ -168,7 +169,7 @@ class DomainRequestAdminForm(forms.ModelForm):
|
||||||
|
|
||||||
# Check if a rejection reason exists. Rejection is not possible without one.
|
# Check if a rejection reason exists. Rejection is not possible without one.
|
||||||
error_message = None
|
error_message = None
|
||||||
if rejection_reason is None:
|
if rejection_reason is None or rejection_reason == "":
|
||||||
# Lets grab the error message from a common location
|
# Lets grab the error message from a common location
|
||||||
error_message = FSMDomainRequestError.get_error_message(FSMErrorCodes.NO_REJECTION_REASON)
|
error_message = FSMDomainRequestError.get_error_message(FSMErrorCodes.NO_REJECTION_REASON)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue