mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-03 19:17:42 +02:00
Code cleanup
This commit is contained in:
parent
e04a8bde61
commit
a1f4932935
1 changed files with 6 additions and 5 deletions
|
@ -578,7 +578,8 @@ class DomainApplication(TimeStampedModel):
|
||||||
changes_dict = json.loads(entry.changes)
|
changes_dict = json.loads(entry.changes)
|
||||||
# changes_dict will look like {'status': ['withdrawn', 'submitted']},
|
# changes_dict will look like {'status': ['withdrawn', 'submitted']},
|
||||||
# henceforth the len(changes_dict.get('status', [])) == 2
|
# henceforth the len(changes_dict.get('status', [])) == 2
|
||||||
if len(changes_dict.get("status", [])) == 2 and changes_dict.get("status", [])[1] == status:
|
status_change = changes_dict.get("status", [])
|
||||||
|
if len(status_change) == 2 and status_change[1] == status:
|
||||||
return True
|
return True
|
||||||
except JSONDecodeError:
|
except JSONDecodeError:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
|
@ -656,7 +657,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
# Limit email notifications for this transition to the first time the request transitions to this status
|
# Limit email notifications for this transition to the first time the request transitions to this status
|
||||||
if not self.has_previously_had_a_status_of("submitted"):
|
if not self.has_previously_had_a_status_of(DomainApplication.ApplicationStatus.SUBMITTED):
|
||||||
self._send_status_update_email(
|
self._send_status_update_email(
|
||||||
"submission confirmation",
|
"submission confirmation",
|
||||||
"emails/submission_confirmation.txt",
|
"emails/submission_confirmation.txt",
|
||||||
|
@ -738,7 +739,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Limit email notifications for this transition to the first time the request transitions to this status
|
# Limit email notifications for this transition to the first time the request transitions to this status
|
||||||
if not self.has_previously_had_a_status_of("approved"):
|
if not self.has_previously_had_a_status_of(DomainApplication.ApplicationStatus.APPROVED):
|
||||||
self._send_status_update_email(
|
self._send_status_update_email(
|
||||||
"application approved",
|
"application approved",
|
||||||
"emails/status_change_approved.txt",
|
"emails/status_change_approved.txt",
|
||||||
|
@ -755,7 +756,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
"""Withdraw an application that has been submitted."""
|
"""Withdraw an application that has been submitted."""
|
||||||
|
|
||||||
# Limit email notifications for this transition to the first time the request transitions to this status
|
# Limit email notifications for this transition to the first time the request transitions to this status
|
||||||
if not self.has_previously_had_a_status_of("withdrawn"):
|
if not self.has_previously_had_a_status_of(DomainApplication.ApplicationStatus.WITHDRAWN):
|
||||||
self._send_status_update_email(
|
self._send_status_update_email(
|
||||||
"withdraw",
|
"withdraw",
|
||||||
"emails/domain_request_withdrawn.txt",
|
"emails/domain_request_withdrawn.txt",
|
||||||
|
@ -787,7 +788,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
logger.error("Can't query an approved domain while attempting a DA reject()")
|
logger.error("Can't query an approved domain while attempting a DA reject()")
|
||||||
|
|
||||||
# Limit email notifications for this transition to the first time the request transitions to this status
|
# Limit email notifications for this transition to the first time the request transitions to this status
|
||||||
if not self.has_previously_had_a_status_of("rejected"):
|
if not self.has_previously_had_a_status_of(DomainApplication.ApplicationStatus.REJECTED):
|
||||||
self._send_status_update_email(
|
self._send_status_update_email(
|
||||||
"action needed",
|
"action needed",
|
||||||
"emails/status_change_rejected.txt",
|
"emails/status_change_rejected.txt",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue