mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-18 02:19:23 +02:00
Action needed status and email
This commit is contained in:
parent
bf93ea7a28
commit
5763bb4a6a
7 changed files with 109 additions and 3 deletions
|
@ -265,6 +265,8 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
||||||
original_obj.submit(updated_domain_application=obj)
|
original_obj.submit(updated_domain_application=obj)
|
||||||
elif obj.status == models.DomainApplication.INVESTIGATING:
|
elif obj.status == models.DomainApplication.INVESTIGATING:
|
||||||
original_obj.in_review(updated_domain_application=obj)
|
original_obj.in_review(updated_domain_application=obj)
|
||||||
|
elif obj.status == models.DomainApplication.ACTION_NEEDED:
|
||||||
|
original_obj.action_needed(updated_domain_application=obj)
|
||||||
elif obj.status == models.DomainApplication.APPROVED:
|
elif obj.status == models.DomainApplication.APPROVED:
|
||||||
original_obj.approve(updated_domain_application=obj)
|
original_obj.approve(updated_domain_application=obj)
|
||||||
elif obj.status == models.DomainApplication.WITHDRAWN:
|
elif obj.status == models.DomainApplication.WITHDRAWN:
|
||||||
|
|
|
@ -18,16 +18,18 @@ class DomainApplication(TimeStampedModel):
|
||||||
|
|
||||||
"""A registrant's application for a new domain."""
|
"""A registrant's application for a new domain."""
|
||||||
|
|
||||||
# #### Contants for choice fields ####
|
# #### Constants for choice fields ####
|
||||||
STARTED = "started"
|
STARTED = "started"
|
||||||
SUBMITTED = "submitted"
|
SUBMITTED = "submitted"
|
||||||
INVESTIGATING = "investigating"
|
INVESTIGATING = "investigating"
|
||||||
|
ACTION_NEEDED = "action needed"
|
||||||
APPROVED = "approved"
|
APPROVED = "approved"
|
||||||
WITHDRAWN = "withdrawn"
|
WITHDRAWN = "withdrawn"
|
||||||
STATUS_CHOICES = [
|
STATUS_CHOICES = [
|
||||||
(STARTED, STARTED),
|
(STARTED, STARTED),
|
||||||
(SUBMITTED, SUBMITTED),
|
(SUBMITTED, SUBMITTED),
|
||||||
(INVESTIGATING, INVESTIGATING),
|
(INVESTIGATING, INVESTIGATING),
|
||||||
|
(ACTION_NEEDED, ACTION_NEEDED),
|
||||||
(APPROVED, APPROVED),
|
(APPROVED, APPROVED),
|
||||||
(WITHDRAWN, WITHDRAWN),
|
(WITHDRAWN, WITHDRAWN),
|
||||||
]
|
]
|
||||||
|
@ -497,7 +499,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
except EmailSendingError:
|
except EmailSendingError:
|
||||||
logger.warning("Failed to send confirmation email", exc_info=True)
|
logger.warning("Failed to send confirmation email", exc_info=True)
|
||||||
|
|
||||||
@transition(field="status", source=[STARTED, WITHDRAWN], target=SUBMITTED)
|
@transition(field="status", source=[STARTED, ACTION_NEEDED, WITHDRAWN], target=SUBMITTED)
|
||||||
def submit(self, updated_domain_application=None):
|
def submit(self, updated_domain_application=None):
|
||||||
"""Submit an application that is started.
|
"""Submit an application that is started.
|
||||||
|
|
||||||
|
@ -555,6 +557,18 @@ class DomainApplication(TimeStampedModel):
|
||||||
"emails/status_change_in_review_subject.txt",
|
"emails/status_change_in_review_subject.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@transition(field="status", source=[INVESTIGATING], target=ACTION_NEEDED)
|
||||||
|
def action_needed(self, updated_domain_application):
|
||||||
|
"""Send back an application that is under investigation or rejected.
|
||||||
|
|
||||||
|
As a side effect, an email notification is sent, similar to in_review"""
|
||||||
|
|
||||||
|
updated_domain_application._send_status_update_email(
|
||||||
|
"action needed",
|
||||||
|
"emails/status_change_action_needed.txt",
|
||||||
|
"emails/status_change_action_needed_subject.txt",
|
||||||
|
)
|
||||||
|
|
||||||
@transition(field="status", source=[SUBMITTED, INVESTIGATING], target=APPROVED)
|
@transition(field="status", source=[SUBMITTED, INVESTIGATING], target=APPROVED)
|
||||||
def approve(self, updated_domain_application=None):
|
def approve(self, updated_domain_application=None):
|
||||||
"""Approve an application that has been submitted.
|
"""Approve an application that has been submitted.
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
</span>
|
</span>
|
||||||
{% if domainapplication.status == 'approved' %} Approved
|
{% if domainapplication.status == 'approved' %} Approved
|
||||||
{% elif domainapplication.status == 'investigating' %} In Review
|
{% elif domainapplication.status == 'investigating' %} In Review
|
||||||
|
{% elif domainapplication.status == 'action needed' %} Action Needed
|
||||||
{% elif domainapplication.status == 'submitted' %} Received
|
{% elif domainapplication.status == 'submitted' %} Received
|
||||||
{% else %}ERROR Please contact technical support/dev
|
{% else %}ERROR Please contact technical support/dev
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
{% autoescape off %}{# In a text file, we don't want to have HTML entities escaped #}
|
||||||
|
Hi {{ application.submitter.first_name }}.
|
||||||
|
|
||||||
|
ACTION NEEDED: Your .gov domain request requires your attention. A CISA analyst will get in touch with you shortly with more details.
|
||||||
|
|
||||||
|
DOMAIN REQUESTED: {{ application.requested_domain.name }}
|
||||||
|
REQUEST RECEIVED ON: {{ application.updated_at|date }}
|
||||||
|
REQUEST #: {{ application.id }}
|
||||||
|
STATUS: Action needed
|
||||||
|
|
||||||
|
|
||||||
|
NEED TO MAKE CHANGES?
|
||||||
|
|
||||||
|
If you need to change your request you have to first withdraw it. Once you
|
||||||
|
withdraw the request you can edit it and submit it again. Changing your request
|
||||||
|
might add to the wait time. Learn more about withdrawing your request.
|
||||||
|
<https://get.gov/help/domain-requests/#withdraw-your-domain-request>.
|
||||||
|
|
||||||
|
|
||||||
|
NEXT STEPS
|
||||||
|
|
||||||
|
- We’re reviewing your request. This usually takes 20 business days.
|
||||||
|
|
||||||
|
- You can check the status of your request at any time.
|
||||||
|
<https://registrar.get.gov/application/{{ application.id }}>
|
||||||
|
|
||||||
|
- We’ll email you with questions or when we complete our review.
|
||||||
|
|
||||||
|
|
||||||
|
THANK YOU
|
||||||
|
|
||||||
|
.Gov helps the public identify official, trusted information. Thank you for
|
||||||
|
requesting a .gov domain.
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
{% include 'emails/includes/application_summary.txt' %}
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
The .gov team
|
||||||
|
Contact us: <https://get.gov/contact/>
|
||||||
|
Visit <https://get.gov>
|
||||||
|
{% endautoescape %}
|
|
@ -0,0 +1 @@
|
||||||
|
ACTION NEEDED: Your .gov domain request requires your attention
|
|
@ -88,7 +88,7 @@
|
||||||
<td data-sort-value="{{ application.created_at|date:"U" }}" data-label="Date created">{{ application.created_at|date }}</td>
|
<td data-sort-value="{{ application.created_at|date:"U" }}" data-label="Date created">{{ application.created_at|date }}</td>
|
||||||
<td data-label="Status">{{ application.status|title }}</td>
|
<td data-label="Status">{{ application.status|title }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if application.status == "started" or application.status == "withdrawn" %}
|
{% if application.status == "started" or application.status == "action needed" or application.status == "withdrawn" %}
|
||||||
<a href="{% url 'edit-application' application.pk %}">
|
<a href="{% url 'edit-application' application.pk %}">
|
||||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24">
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24">
|
||||||
<use xlink:href="{%static 'img/sprite.svg'%}#edit"></use>
|
<use xlink:href="{%static 'img/sprite.svg'%}#edit"></use>
|
||||||
|
|
|
@ -198,6 +198,51 @@ class TestDomainApplication(TestCase):
|
||||||
with self.assertRaises(TransitionNotAllowed):
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
application.in_review()
|
application.in_review()
|
||||||
|
|
||||||
|
def test_transition_not_allowed_started_action_needed(self):
|
||||||
|
"""Create an application with status started and call action_needed
|
||||||
|
against transition rules"""
|
||||||
|
|
||||||
|
application = completed_application(status=DomainApplication.STARTED)
|
||||||
|
|
||||||
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
|
application.action_needed()
|
||||||
|
|
||||||
|
def test_transition_not_allowed_submitted_action_needed(self):
|
||||||
|
"""Create an application with status submitted and call action_needed
|
||||||
|
against transition rules"""
|
||||||
|
|
||||||
|
application = completed_application(status=DomainApplication.SUBMITTED)
|
||||||
|
|
||||||
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
|
application.action_needed()
|
||||||
|
|
||||||
|
def test_transition_not_allowed_action_needed_action_needed(self):
|
||||||
|
"""Create an application with status action needed and call action_needed
|
||||||
|
against transition rules"""
|
||||||
|
|
||||||
|
application = completed_application(status=DomainApplication.ACTION_NEEDED)
|
||||||
|
|
||||||
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
|
application.action_needed()
|
||||||
|
|
||||||
|
def test_transition_not_allowed_approved_action_needed(self):
|
||||||
|
"""Create an application with status approved and call action_needed
|
||||||
|
against transition rules"""
|
||||||
|
|
||||||
|
application = completed_application(status=DomainApplication.APPROVED)
|
||||||
|
|
||||||
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
|
application.action_needed()
|
||||||
|
|
||||||
|
def test_transition_not_allowed_withdrawn_action_needed(self):
|
||||||
|
"""Create an application with status withdrawn and call action_needed
|
||||||
|
against transition rules"""
|
||||||
|
|
||||||
|
application = completed_application(status=DomainApplication.WITHDRAWN)
|
||||||
|
|
||||||
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
|
application.action_needed()
|
||||||
|
|
||||||
def test_transition_not_allowed_started_approved(self):
|
def test_transition_not_allowed_started_approved(self):
|
||||||
"""Create an application with status started and call approve
|
"""Create an application with status started and call approve
|
||||||
against transition rules"""
|
against transition rules"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue