Update admin.py

This commit is contained in:
zandercymatics 2024-03-12 15:48:46 -06:00
parent a5a3c13653
commit 5661174a2d
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -149,7 +149,7 @@ class DomainRequestAdminForm(forms.ModelForm):
# If a status change occured, check for validity
if status != initial_status and status in checked_statuses:
# Checks the "investigators" field for validity.
# That field must obey certain conditions when an domain_request is approved.
# That field must obey certain conditions when an domain request is approved.
# Will call "add_error" if any issues are found.
self._check_for_valid_investigator(investigator)
@ -1163,7 +1163,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
# == Handle non-status changes == #
# Get the original domain_request from the database.
# Get the original domain request from the database.
original_obj = models.DomainRequest.objects.get(pk=obj.pk)
if obj.status == original_obj.status:
# If the status hasn't changed, let the base function take care of it
@ -1205,7 +1205,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
request_is_not_approved = obj.status != models.DomainRequest.DomainRequestStatus.APPROVED
if request_is_not_approved and not obj.domain_is_not_active():
# If an admin tried to set an approved domain_request to
# If an admin tried to set an approved domain request to
# 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
@ -1248,7 +1248,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
return (obj, should_proceed)
def get_status_method_mapping(self, domain_request):
"""Returns what method should be ran given an DomainRequest object"""
"""Returns what method should be ran given an domain request object"""
# Define a per-object mapping
status_method_mapping = {
models.DomainRequest.DomainRequestStatus.STARTED: None,