mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-20 11:29:25 +02:00
Update admin.py
This commit is contained in:
parent
a5a3c13653
commit
5661174a2d
1 changed files with 4 additions and 4 deletions
|
@ -149,7 +149,7 @@ class DomainRequestAdminForm(forms.ModelForm):
|
||||||
# If a status change occured, check for validity
|
# If a status change occured, check for validity
|
||||||
if status != initial_status and status in checked_statuses:
|
if status != initial_status and status in checked_statuses:
|
||||||
# Checks the "investigators" field for validity.
|
# 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.
|
# Will call "add_error" if any issues are found.
|
||||||
self._check_for_valid_investigator(investigator)
|
self._check_for_valid_investigator(investigator)
|
||||||
|
|
||||||
|
@ -1163,7 +1163,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
# == Handle non-status changes == #
|
# == 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)
|
original_obj = models.DomainRequest.objects.get(pk=obj.pk)
|
||||||
if obj.status == original_obj.status:
|
if obj.status == original_obj.status:
|
||||||
# If the status hasn't changed, let the base function take care of it
|
# 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
|
request_is_not_approved = obj.status != models.DomainRequest.DomainRequestStatus.APPROVED
|
||||||
if request_is_not_approved and not obj.domain_is_not_active():
|
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
|
# another status and the related domain is already
|
||||||
# active, shortcut the action and throw a friendly
|
# active, shortcut the action and throw a friendly
|
||||||
# error message. This action would still not go through
|
# error message. This action would still not go through
|
||||||
|
@ -1248,7 +1248,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
|
||||||
return (obj, should_proceed)
|
return (obj, should_proceed)
|
||||||
|
|
||||||
def get_status_method_mapping(self, domain_request):
|
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
|
# Define a per-object mapping
|
||||||
status_method_mapping = {
|
status_method_mapping = {
|
||||||
models.DomainRequest.DomainRequestStatus.STARTED: None,
|
models.DomainRequest.DomainRequestStatus.STARTED: None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue