mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 18:09:25 +02:00
linting
This commit is contained in:
parent
4bdf2cbe8f
commit
0641e9ad72
4 changed files with 6 additions and 10 deletions
|
@ -1746,7 +1746,6 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
obj.action_needed_reason_email = body_text
|
obj.action_needed_reason_email = body_text
|
||||||
should_save = True
|
should_save = True
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
return super().save_model(request, obj, form, change)
|
return super().save_model(request, obj, form, change)
|
||||||
|
@ -1968,7 +1967,9 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
if domain_request.action_needed_reason == enum_value and domain_request.action_needed_reason_email:
|
if domain_request.action_needed_reason == enum_value and domain_request.action_needed_reason_email:
|
||||||
custom_text = domain_request.action_needed_reason_email
|
custom_text = domain_request.action_needed_reason_email
|
||||||
|
|
||||||
emails[enum_value] = self._get_action_needed_reason_default_email_text(domain_request, enum_value, custom_text)
|
emails[enum_value] = self._get_action_needed_reason_default_email_text(
|
||||||
|
domain_request, enum_value, custom_text
|
||||||
|
)
|
||||||
return json.dumps(emails)
|
return json.dumps(emails)
|
||||||
|
|
||||||
def _get_action_needed_reason_default_email_text(self, domain_request, action_needed_reason: str, custom_text=None):
|
def _get_action_needed_reason_default_email_text(self, domain_request, action_needed_reason: str, custom_text=None):
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
import hashlib
|
|
||||||
from urllib.parse import urlparse, urlunparse, urlencode
|
from urllib.parse import urlparse, urlunparse, urlencode
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1485,9 +1485,7 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
domain_request.save()
|
domain_request.save()
|
||||||
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=questionable_so)
|
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=questionable_so)
|
||||||
|
|
||||||
self.assert_email_is_accurate(
|
self.assert_email_is_accurate("custom email content", 4, EMAIL, bcc_email_address=BCC_EMAIL)
|
||||||
"custom email content", 4, EMAIL, bcc_email_address=BCC_EMAIL
|
|
||||||
)
|
|
||||||
self.assertEqual(len(self.mock_client.EMAILS_SENT), 5)
|
self.assertEqual(len(self.mock_client.EMAILS_SENT), 5)
|
||||||
|
|
||||||
def test_save_model_sends_submitted_email(self):
|
def test_save_model_sends_submitted_email(self):
|
||||||
|
@ -2234,6 +2232,7 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
self.assertContains(response, "Yes, select ineligible status")
|
self.assertContains(response, "Yes, select ineligible status")
|
||||||
|
|
||||||
def test_readonly_when_restricted_creator(self):
|
def test_readonly_when_restricted_creator(self):
|
||||||
|
self.maxDiff = None
|
||||||
with less_console_noise():
|
with less_console_noise():
|
||||||
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW)
|
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW)
|
||||||
with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
|
with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
|
||||||
|
@ -2252,7 +2251,6 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
"is_election_board",
|
"is_election_board",
|
||||||
"federal_agency",
|
"federal_agency",
|
||||||
"status_history",
|
"status_history",
|
||||||
"action_needed_reason_email",
|
|
||||||
"id",
|
"id",
|
||||||
"created_at",
|
"created_at",
|
||||||
"updated_at",
|
"updated_at",
|
||||||
|
@ -2314,7 +2312,6 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
"is_election_board",
|
"is_election_board",
|
||||||
"federal_agency",
|
"federal_agency",
|
||||||
"status_history",
|
"status_history",
|
||||||
"action_needed_reason_email",
|
|
||||||
"creator",
|
"creator",
|
||||||
"about_your_organization",
|
"about_your_organization",
|
||||||
"requested_domain",
|
"requested_domain",
|
||||||
|
@ -2346,7 +2343,6 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
"is_election_board",
|
"is_election_board",
|
||||||
"federal_agency",
|
"federal_agency",
|
||||||
"status_history",
|
"status_history",
|
||||||
"action_needed_reason_email",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
self.assertEqual(readonly_fields, expected_fields)
|
self.assertEqual(readonly_fields, expected_fields)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue