Update admin.py

This commit is contained in:
zandercymatics 2024-03-13 12:35:56 -06:00
parent 4be6979af5
commit d0b252b354
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -133,6 +133,7 @@ class DomainRequestAdminForm(forms.ModelForm):
cleaned_data = super().clean()
status = cleaned_data.get("status")
investigator = cleaned_data.get("investigator")
rejection_reason = cleaned_data.get("rejection_reason")
# Get the old status
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.
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
error_message = FSMDomainRequestError.get_error_message(FSMErrorCodes.NO_REJECTION_REASON)
else: