Skip to content

Commit

Permalink
Merge pull request #3156 from cisagov/el/2372-change-rejection-title
Browse files Browse the repository at this point in the history
#2371: Change action needed reason from 'Already has domains' to 'Already has a domain' [EL]
  • Loading branch information
lizpearl authored Dec 6, 2024
2 parents 54b85d8 + 7b0d7d3 commit 2ed3ea6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.10 on 2024-11-27 21:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("registrar", "0138_alter_domaininvitation_status"),
]

operations = [
migrations.AlterField(
model_name="domainrequest",
name="action_needed_reason",
field=models.TextField(
blank=True,
choices=[
("eligibility_unclear", "Unclear organization eligibility"),
("questionable_senior_official", "Questionable senior official"),
("already_has_a_domain", "Already has a domain"),
("bad_name", "Doesn’t meet naming requirements"),
("other", "Other (no auto-email sent)"),
],
null=True,
),
),
]
2 changes: 1 addition & 1 deletion src/registrar/models/domain_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class ActionNeededReasons(models.TextChoices):

ELIGIBILITY_UNCLEAR = ("eligibility_unclear", "Unclear organization eligibility")
QUESTIONABLE_SENIOR_OFFICIAL = ("questionable_senior_official", "Questionable senior official")
ALREADY_HAS_DOMAINS = ("already_has_domains", "Already has domains")
ALREADY_HAS_A_DOMAIN = ("already_has_a_domain", "Already has a domain")
BAD_NAME = ("bad_name", "Doesn’t meet naming requirements")
OTHER = ("other", "Other (no auto-email sent)")

Expand Down
12 changes: 6 additions & 6 deletions src/registrar/tests/test_admin_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def assert_status_order(normalized_content, statuses):
domain_request.save()

domain_request.action_needed()
domain_request.action_needed_reason = DomainRequest.ActionNeededReasons.ALREADY_HAS_DOMAINS
domain_request.action_needed_reason = DomainRequest.ActionNeededReasons.ALREADY_HAS_A_DOMAIN
domain_request.save()

# Let's just change the action needed reason
Expand All @@ -230,7 +230,7 @@ def assert_status_order(normalized_content, statuses):
"In review",
"Rejected - Purpose requirements not met",
"Action needed - Unclear organization eligibility",
"Action needed - Already has domains",
"Action needed - Already has a domain",
"In review",
"Submitted",
"Started",
Expand All @@ -241,7 +241,7 @@ def assert_status_order(normalized_content, statuses):
assert_status_count(normalized_content, "Started", 1)
assert_status_count(normalized_content, "Submitted", 1)
assert_status_count(normalized_content, "In review", 2)
assert_status_count(normalized_content, "Action needed - Already has domains", 1)
assert_status_count(normalized_content, "Action needed - Already has a domain", 1)
assert_status_count(normalized_content, "Action needed - Unclear organization eligibility", 1)
assert_status_count(normalized_content, "Rejected - Purpose requirements not met", 1)

Expand Down Expand Up @@ -685,9 +685,9 @@ def test_action_needed_sends_reason_email_prod_bcc(self):
# Create a sample domain request
domain_request = completed_domain_request(status=in_review, user=_creator)

# Test the email sent out for already_has_domains
already_has_domains = DomainRequest.ActionNeededReasons.ALREADY_HAS_DOMAINS
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=already_has_domains)
# Test the email sent out for already_has_a_domain
already_has_a_domain = DomainRequest.ActionNeededReasons.ALREADY_HAS_A_DOMAIN
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=already_has_a_domain)

self.assert_email_is_accurate("ORGANIZATION ALREADY HAS A .GOV DOMAIN", 0, EMAIL, bcc_email_address=BCC_EMAIL)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
Expand Down

0 comments on commit 2ed3ea6

Please sign in to comment.