mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-28 13:36:30 +02:00
Remove no longer relevant test + linting
This commit is contained in:
parent
ad43fabbab
commit
997fc1bbed
3 changed files with 12 additions and 15 deletions
|
@ -1942,12 +1942,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
|
||||
# == Handle action needed and rejected emails == #
|
||||
# Edge case: this logic is handled by javascript, so contexts outside that must be handled
|
||||
if obj.status == DomainRequest.DomainRequestStatus.ACTION_NEEDED:
|
||||
if obj.action_needed_reason and not obj.action_needed_reason_email:
|
||||
obj.action_needed_reason_email = get_action_needed_reason_default_email(obj, obj.action_needed_reason)
|
||||
elif obj.status == DomainRequest.DomainRequestStatus.REJECTED:
|
||||
if obj.rejection_reason and not obj.rejection_reason_email:
|
||||
obj.rejection_reason_email = get_rejection_reason_default_email(obj, obj.rejection_reason)
|
||||
obj = self._handle_custom_emails()
|
||||
|
||||
# == Handle allowed emails == #
|
||||
if obj.status in DomainRequest.get_statuses_that_send_emails() and not settings.IS_PRODUCTION:
|
||||
|
@ -1965,6 +1960,15 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
if should_save:
|
||||
return super().save_model(request, obj, form, change)
|
||||
|
||||
def _handle_custom_emails(self, obj):
|
||||
if obj.status == DomainRequest.DomainRequestStatus.ACTION_NEEDED:
|
||||
if obj.action_needed_reason and not obj.action_needed_reason_email:
|
||||
obj.action_needed_reason_email = get_action_needed_reason_default_email(obj, obj.action_needed_reason)
|
||||
elif obj.status == DomainRequest.DomainRequestStatus.REJECTED:
|
||||
if obj.rejection_reason and not obj.rejection_reason_email:
|
||||
obj.rejection_reason_email = get_rejection_reason_default_email(obj, obj.rejection_reason)
|
||||
return obj
|
||||
|
||||
def _check_for_valid_email(self, request, obj):
|
||||
"""Certain emails are whitelisted in non-production environments,
|
||||
so we should display that information using this function.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue