From d860bbdb8b5714296305d0091c16bdeeac901213 Mon Sep 17 00:00:00 2001 From: Rachid Mrad Date: Mon, 26 Feb 2024 17:28:29 -0500 Subject: [PATCH] Tweak email templates, model copy --- ...0070_domainapplication_rejection_reason.py | 22 +++++++------------ src/registrar/models/domain_application.py | 18 +++++++-------- .../emails/status_change_rejected.txt | 12 +++++----- src/registrar/tests/test_admin.py | 4 ++-- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/registrar/migrations/0070_domainapplication_rejection_reason.py b/src/registrar/migrations/0070_domainapplication_rejection_reason.py index 60dc8ac73..d559973e2 100644 --- a/src/registrar/migrations/0070_domainapplication_rejection_reason.py +++ b/src/registrar/migrations/0070_domainapplication_rejection_reason.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.7 on 2024-02-16 19:36 +# Generated by Django 4.2.7 on 2024-02-26 22:12 from django.db import migrations, models @@ -15,19 +15,13 @@ class Migration(migrations.Migration): field=models.TextField( blank=True, choices=[ - ("domain_purpose", "Domain purpose requirements not met"), - ("requestor", "Requestor isn't authorized to make the request"), - ( - "second_domain_reasoning", - "Organization already has a domain and does not provide sufficient reasoning for a second domain", - ), - ( - "contacts_or_organization_legitimacy", - "Research could not corroborate legitimacy of contacts or organization", - ), - ("organization_eligibility", "Organization isn't eligible for a .gov"), - ("naming_requirements", "Naming requirements not met"), - ("other", "Other"), + ("purpose_not_met", "Purpose requirements not met"), + ("requestor_not_eligible", "Requestor not eligible to make request"), + ("org_has_domain", "Org already has a .gov domain"), + ("contacts_not_verified", "Org contacts couldn't be verified"), + ("org_not_eligible", "Org not eligible for a .gov domain"), + ("naming_not_met", "Naming requirements not met"), + ("other", "Other/Unspecified"), ], null=True, ), diff --git a/src/registrar/models/domain_application.py b/src/registrar/models/domain_application.py index 11b456337..1d0a9b332 100644 --- a/src/registrar/models/domain_application.py +++ b/src/registrar/models/domain_application.py @@ -352,19 +352,19 @@ class DomainApplication(TimeStampedModel): AGENCY_CHOICES = [(v, v) for v in AGENCIES] class RejectionReasons(models.TextChoices): - DOMAIN_PURPOSE = "domain_purpose", "Domain purpose requirements not met" - REQUESTOR = "requestor", "Requestor isn't authorized to make the request" + DOMAIN_PURPOSE = "purpose_not_met", "Purpose requirements not met" + REQUESTOR = "requestor_not_eligible", "Requestor not eligible to make request" SECOND_DOMAIN_REASONING = ( - "second_domain_reasoning", - "Organization already has a domain and does not provide sufficient reasoning for a second domain", + "org_has_domain", + "Org already has a .gov domain", ) CONTACTS_OR_ORGANIZATION_LEGITIMACY = ( - "contacts_or_organization_legitimacy", - "Research could not corroborate legitimacy of contacts or organization", + "contacts_not_verified", + "Org contacts couldn't be verified", ) - ORGANIZATION_ELIGIBILITY = "organization_eligibility", "Organization isn't eligible for a .gov" - NAMING_REQUIREMENTS = "naming_requirements", "Naming requirements not met" - OTHER = "other", "Other" + ORGANIZATION_ELIGIBILITY = "org_not_eligible", "Org not eligible for a .gov domain" + NAMING_REQUIREMENTS = "naming_not_met", "Naming requirements not met" + OTHER = "other", "Other/Unspecified" # #### Internal fields about the application ##### status = FSMField( diff --git a/src/registrar/templates/emails/status_change_rejected.txt b/src/registrar/templates/emails/status_change_rejected.txt index b9c89be07..0ece4b8ed 100644 --- a/src/registrar/templates/emails/status_change_rejected.txt +++ b/src/registrar/templates/emails/status_change_rejected.txt @@ -9,7 +9,7 @@ STATUS: Rejected ---------------------------------------------------------------- {% if application.rejection_reason != 'other' %} -REJECTION REASON{% endif %}{% if application.rejection_reason == 'domain_purpose' %} +REJECTION REASON{% endif %}{% if application.rejection_reason == 'purpose_not_met' %} Your domain request was rejected because the purpose you provided did not meet our requirements. You didn’t provide enough information about how you intend to use the domain. @@ -18,7 +18,7 @@ Learn more about: - Eligibility for a .gov domain - What you can and can’t do with .gov domains -If you have questions or comments, reply to this email.{% elif application.rejection_reason == 'requestor' %} +If you have questions or comments, reply to this email.{% elif application.rejection_reason == 'requestor_not_eligible' %} Your domain request was rejected because we don’t believe you’re eligible to request a .gov domain on behalf of {{ application.organization_name }}. You must be a government employee, or be working on behalf of a government organization, to request a .gov domain. @@ -26,7 +26,7 @@ working on behalf of a government organization, to request a .gov domain. DEMONSTRATE ELIGIBILITY If you can provide more information that demonstrates your eligibility, or you want to -discuss further, reply to this email.{% elif application.rejection_reason == 'second_domain_reasoning' %} +discuss further, reply to this email.{% elif application.rejection_reason == 'org_has_domain' %} Your domain request was rejected because {{ application.organization_name }} has a .gov domain. Our practice is to approve one domain per online service per government organization. We evaluate additional requests on a case-by-case basis. You did not provide sufficient @@ -35,9 +35,9 @@ justification for an additional domain. Read more about our practice of approving one domain per online service . -If you have questions or comments, reply to this email.{% elif application.rejection_reason == 'contacts_or_organization_legitimacy' %} +If you have questions or comments, reply to this email.{% elif application.rejection_reason == 'contacts_not_verified' %} Your domain request was rejected because we could not verify the organizational -contacts you provided. If you have questions or comments, reply to this email.{% elif application.rejection_reason == 'organization_eligibility' %} +contacts you provided. If you have questions or comments, reply to this email.{% elif application.rejection_reason == 'org_not_eligible' %} Your domain request was rejected because we determined that {{ application.organization_name }} is not eligible for a .gov domain. .Gov domains are only available to official U.S.-based government organizations. @@ -48,7 +48,7 @@ If you can provide documentation that demonstrates your eligibility, reply to th This can include links to (or copies of) your authorizing legislation, your founding charter or bylaws, or other similar documentation. Without this, we can’t approve a .gov domain for your organization. Learn more about eligibility for .gov domains -.{% elif application.rejection_reason == 'naming_requirements' %} +.{% elif application.rejection_reason == 'naming_not_met' %} Your domain request was rejected because it does not meet our naming requirements. Domains should uniquely identify a government organization and be clear to the general public. Learn more about naming requirements for your type of organization diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index f88721649..7bef239fc 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -784,7 +784,7 @@ class TestDomainApplicationAdmin(MockEppLib): self.transition_state_and_send_email(application, DomainApplication.ApplicationStatus.APPROVED) self.assertEqual(len(self.mock_client.EMAILS_SENT), 3) - def test_save_model_sends_rejected_email_domain_purpose(self): + def test_save_model_sends_rejected_email_purpose_not_met(self): """When transitioning to rejected on a domain request, an email is sent explaining why when the reason is domain purpose.""" @@ -843,7 +843,7 @@ class TestDomainApplicationAdmin(MockEppLib): self.assert_email_is_accurate("Congratulations! Your .gov domain request has been approved.", 1, EMAIL) self.assertEqual(len(self.mock_client.EMAILS_SENT), 2) - def test_save_model_sends_rejected_email_second_domain_reasoning(self): + def test_save_model_sends_rejected_email_org_has_domain(self): """When transitioning to rejected on a domain request, an email is sent explaining why when the reason is second domain."""