mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Text updates to success and error messages (#1593)
* Text updates to error messages * Error message text updates * Error message text updates * Update to success message text for name server update * Update to DS data removal warning text * Success message text updates * typo fix * Text updates for success messages * Update 403 text * Update 500 error text * Using example.com instead of city.com * Putting the period outside the link * Updated name server minimum error text * Trying to fix python errors * Update name server minimum text * Update errors.py * Trying to fix python errors * Update errors.py * Making error messages agree * Minor text change * Fix black error message formatting * Fixed tests and reformatted * One last fix? --------- Co-authored-by: Neil Martinsen-Burrell <neil.martinsen-burrell@gsa.gov>
This commit is contained in:
parent
f8d2898836
commit
e2af9ac153
13 changed files with 41 additions and 37 deletions
|
@ -29,7 +29,7 @@ DOMAIN_API_MESSAGES = {
|
|||
"unavailable": mark_safe( # nosec
|
||||
"That domain isn’t available. "
|
||||
"<a class='usa-link' href='{}' target='_blank'>"
|
||||
"Read more about choosing your .gov domain.</a>".format(public_site_url("domains/choosing"))
|
||||
"Read more about choosing your .gov domain</a>.".format(public_site_url("domains/choosing"))
|
||||
),
|
||||
"invalid": "Enter a domain using only letters, numbers, or hyphens (though we don't recommend using hyphens).",
|
||||
"success": "That domain is available! We’ll try to give you the domain you want, \
|
||||
|
|
|
@ -51,7 +51,7 @@ class ViewsTest(TestCase):
|
|||
# assert
|
||||
self.assertEqual(response.status_code, 500)
|
||||
self.assertTemplateUsed(response, "500.html")
|
||||
self.assertIn("server error", response.content.decode("utf-8"))
|
||||
self.assertIn("Server error", response.content.decode("utf-8"))
|
||||
|
||||
def test_login_callback_reads_next(self, mock_client):
|
||||
# setup
|
||||
|
|
|
@ -1251,7 +1251,7 @@ admin.site.register(models.DomainInformation, DomainInformationAdmin)
|
|||
admin.site.register(models.Domain, DomainAdmin)
|
||||
admin.site.register(models.DraftDomain, DraftDomainAdmin)
|
||||
# Host and HostIP removed from django admin because changes in admin
|
||||
# do not propogate to registry and logic not applied
|
||||
# do not propagate to registry and logic not applied
|
||||
# admin.site.register(models.Host, MyHostAdmin)
|
||||
admin.site.register(models.Website, WebsiteAdmin)
|
||||
admin.site.register(models.PublicContact, AuditedAdmin)
|
||||
|
|
|
@ -262,7 +262,7 @@ class OrganizationContactForm(RegistrarForm):
|
|||
validators=[
|
||||
RegexValidator(
|
||||
"^[0-9]{5}(?:-[0-9]{4})?$|^$",
|
||||
message="Enter a zip code in the required format, like 12345 or 12345-6789.",
|
||||
message="Enter a zip code in the form of 12345 or 12345-6789.",
|
||||
)
|
||||
],
|
||||
)
|
||||
|
@ -353,7 +353,7 @@ class CurrentSitesForm(RegistrarForm):
|
|||
required=False,
|
||||
label="Public website",
|
||||
error_messages={
|
||||
"invalid": ("Enter your organization's current website in the required format, like www.city.com.")
|
||||
"invalid": ("Enter your organization's current website in the required format, like example.com.")
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -543,7 +543,7 @@ class YourContactForm(RegistrarForm):
|
|||
)
|
||||
phone = PhoneNumberField(
|
||||
label="Phone",
|
||||
error_messages={"required": "Enter your phone number."},
|
||||
error_messages={"invalid": "Enter a valid 10-digit phone number.", "required": "Enter your phone number."},
|
||||
)
|
||||
|
||||
|
||||
|
@ -574,7 +574,10 @@ class OtherContactsForm(RegistrarForm):
|
|||
)
|
||||
phone = PhoneNumberField(
|
||||
label="Phone",
|
||||
error_messages={"required": "Enter a phone number for this contact."},
|
||||
error_messages={
|
||||
"invalid": "Enter a valid 10-digit phone number.",
|
||||
"required": "Enter a phone number for this contact.",
|
||||
},
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
|
|
|
@ -59,7 +59,7 @@ class DomainNameserverForm(forms.Form):
|
|||
# add custom error messages
|
||||
self.fields["server"].error_messages.update(
|
||||
{
|
||||
"required": "A minimum of 2 name servers are required.",
|
||||
"required": "At least two name servers are required.",
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
<div class="grid-row grow-gap">
|
||||
<div class="tablet:grid-col-6 usa-prose margin-bottom-3">
|
||||
<h1>
|
||||
{% translate "You do not have the right permissions to view this page." %}
|
||||
{% translate "You're not authorized to view this page." %}
|
||||
</h1>
|
||||
<h2>
|
||||
{% translate "Status 403" %}
|
||||
{% translate "403 error" %}
|
||||
</h2>
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
{% endif %}
|
||||
<p>
|
||||
You must be an authorized user and need to be signed in to view this page.
|
||||
<a href="{% url 'login' %}"> Try logging in again</a>.
|
||||
<a href="{% url 'login' %}"> Try signing in again</a>.
|
||||
</p>
|
||||
<p>
|
||||
If you'd like help with this error <a class="usa-link" rel="noopener noreferrer" target="_blank" href="{% public_site_url 'contact' %}">contact us</a>.
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
<div class="grid-row grid-gap">
|
||||
<div class="tablet:grid-col-6 usa-prose margin-bottom-3">
|
||||
<h1>
|
||||
{% translate "We're having some trouble" %}
|
||||
{% translate "We're having some trouble." %}
|
||||
</h1>
|
||||
<h2>
|
||||
{% translate "Status 500 – server error" %}
|
||||
{% translate "500 error" %}
|
||||
</h2>
|
||||
{% if friendly_message %}
|
||||
<p>{{ friendly_message }}</p>
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
aria-describedby="Your DNSSEC records will be deleted from the registry."
|
||||
data-force-action
|
||||
>
|
||||
{% include 'includes/modal.html' with cancel_button_resets_ds_form=True modal_heading="Warning: You are about to remove all DS records on your domain" modal_description="To fully disable DNSSEC: In addition to removing your DS records here you’ll also need to delete the DS records at your DNS host. To avoid causing your domain to appear offline you should wait to delete your DS records at your DNS host until the Time to Live (TTL) expires. This is often less than 24 hours, but confirm with your provider." modal_button=modal_button|safe %}
|
||||
{% include 'includes/modal.html' with cancel_button_resets_ds_form=True modal_heading="Warning: You are about to remove all DS records on your domain." modal_description="To fully disable DNSSEC: In addition to removing your DS records here, you’ll need to delete the DS records at your DNS host. To avoid causing your domain to appear offline, you should wait to delete your DS records at your DNS host until the Time to Live (TTL) expires. This is often less than 24 hours, but confirm with your provider." modal_button=modal_button|safe %}
|
||||
</div>
|
||||
|
||||
{% endblock %} {# domain_content #}
|
||||
|
|
|
@ -30,7 +30,7 @@ class TestFormValidation(MockEppLib):
|
|||
form = OrganizationContactForm(data={"zipcode": "nah"})
|
||||
self.assertEqual(
|
||||
form.errors["zipcode"],
|
||||
["Enter a zip code in the required format, like 12345 or 12345-6789."],
|
||||
["Enter a zip code in the form of 12345 or 12345-6789."],
|
||||
)
|
||||
|
||||
def test_org_contact_zip_valid(self):
|
||||
|
@ -42,7 +42,7 @@ class TestFormValidation(MockEppLib):
|
|||
form = CurrentSitesForm(data={"website": "nah"})
|
||||
self.assertEqual(
|
||||
form.errors["website"],
|
||||
["Enter your organization's current website in the required format, like www.city.com."],
|
||||
["Enter your organization's current website in the required format, like example.com."],
|
||||
)
|
||||
|
||||
def test_website_valid(self):
|
||||
|
@ -207,7 +207,7 @@ class TestFormValidation(MockEppLib):
|
|||
def test_your_contact_phone_invalid(self):
|
||||
"""Must be a valid phone number."""
|
||||
form = YourContactForm(data={"phone": "boss@boss"})
|
||||
self.assertTrue(form.errors["phone"][0].startswith("Enter a valid phone number "))
|
||||
self.assertTrue(form.errors["phone"][0].startswith("Enter a valid 10-digit phone number."))
|
||||
|
||||
def test_other_contact_email_invalid(self):
|
||||
"""must be a valid email address."""
|
||||
|
@ -220,7 +220,7 @@ class TestFormValidation(MockEppLib):
|
|||
def test_other_contact_phone_invalid(self):
|
||||
"""Must be a valid phone number."""
|
||||
form = OtherContactsForm(data={"phone": "super@boss"})
|
||||
self.assertTrue(form.errors["phone"][0].startswith("Enter a valid phone number "))
|
||||
self.assertTrue(form.errors["phone"][0].startswith("Enter a valid 10-digit phone number."))
|
||||
|
||||
def test_requirements_form_blank(self):
|
||||
"""Requirements box unchecked is an error."""
|
||||
|
|
|
@ -10,7 +10,7 @@ class TestNameserverError(TestCase):
|
|||
def test_with_no_ip(self):
|
||||
"""Test NameserverError when no ip address is passed"""
|
||||
nameserver = "nameserver val"
|
||||
expected = "Using your domain for a name server requires an IP address"
|
||||
expected = "Using your domain for a name server requires an IP address."
|
||||
|
||||
nsException = NameserverError(code=nsErrorCodes.MISSING_IP, nameserver=nameserver)
|
||||
self.assertEqual(nsException.message, expected)
|
||||
|
@ -20,7 +20,7 @@ class TestNameserverError(TestCase):
|
|||
"""Test NameserverError when no ip address
|
||||
and no nameserver is passed"""
|
||||
nameserver = "nameserver val"
|
||||
expected = "Too many hosts provided, you may not have more than 13 nameservers."
|
||||
expected = "You can't have more than 13 nameservers."
|
||||
|
||||
nsException = NameserverError(code=nsErrorCodes.TOO_MANY_HOSTS, nameserver=nameserver)
|
||||
self.assertEqual(nsException.message, expected)
|
||||
|
|
|
@ -1974,7 +1974,7 @@ class TestDomainNameservers(TestDomainOverview):
|
|||
# the required field. form requires a minimum of 2 name servers
|
||||
self.assertContains(
|
||||
result,
|
||||
"A minimum of 2 name servers are required.",
|
||||
"At least two name servers are required.",
|
||||
count=2,
|
||||
status_code=200,
|
||||
)
|
||||
|
@ -2215,7 +2215,7 @@ class TestDomainNameservers(TestDomainOverview):
|
|||
# once around each required field.
|
||||
self.assertContains(
|
||||
result,
|
||||
"A minimum of 2 name servers are required.",
|
||||
"At least two name servers are required.",
|
||||
count=4,
|
||||
status_code=200,
|
||||
)
|
||||
|
|
|
@ -44,8 +44,8 @@ class GenericError(Exception):
|
|||
|
||||
_error_mapping = {
|
||||
GenericErrorCodes.CANNOT_CONTACT_REGISTRY: (
|
||||
"We’re experiencing a system connection error. Please wait a few minutes "
|
||||
"and try again. If you continue to receive this error after a few tries, "
|
||||
"We’re experiencing a system error. Please wait a few minutes "
|
||||
"and try again. If you continue to get this error, "
|
||||
"contact help@get.gov."
|
||||
),
|
||||
GenericErrorCodes.GENERIC_ERROR: ("Value entered was wrong."),
|
||||
|
@ -97,13 +97,15 @@ class NameserverError(Exception):
|
|||
"""
|
||||
|
||||
_error_mapping = {
|
||||
NameserverErrorCodes.MISSING_IP: ("Using your domain for a name server requires an IP address"),
|
||||
NameserverErrorCodes.MISSING_IP: ("Using your domain for a name server requires an IP address."),
|
||||
NameserverErrorCodes.GLUE_RECORD_NOT_ALLOWED: ("Name server address does not match domain name"),
|
||||
NameserverErrorCodes.INVALID_IP: ("{}: Enter an IP address in the required format."),
|
||||
NameserverErrorCodes.TOO_MANY_HOSTS: ("Too many hosts provided, you may not have more than 13 nameservers."),
|
||||
NameserverErrorCodes.MISSING_HOST: ("Name server must be provided to enter IP address."),
|
||||
NameserverErrorCodes.TOO_MANY_HOSTS: ("You can't have more than 13 nameservers."),
|
||||
NameserverErrorCodes.MISSING_HOST: ("You must provide a name server to enter an IP address."),
|
||||
NameserverErrorCodes.INVALID_HOST: ("Enter a name server in the required format, like ns1.example.com"),
|
||||
NameserverErrorCodes.DUPLICATE_HOST: ("Remove duplicate entry"),
|
||||
NameserverErrorCodes.DUPLICATE_HOST: (
|
||||
"You already entered this name server address. Name server addresses must be unique."
|
||||
),
|
||||
NameserverErrorCodes.BAD_DATA: (
|
||||
"There’s something wrong with the name server information you provided. "
|
||||
"If you need help email us at help@get.gov."
|
||||
|
@ -156,8 +158,8 @@ class DsDataError(Exception):
|
|||
),
|
||||
DsDataErrorCodes.INVALID_DIGEST_SHA1: ("SHA-1 digest must be exactly 40 characters."),
|
||||
DsDataErrorCodes.INVALID_DIGEST_SHA256: ("SHA-256 digest must be exactly 64 characters."),
|
||||
DsDataErrorCodes.INVALID_DIGEST_CHARS: ("Digest must contain only alphanumeric characters [0-9,a-f]."),
|
||||
DsDataErrorCodes.INVALID_KEYTAG_SIZE: ("Key tag must be less than 65535"),
|
||||
DsDataErrorCodes.INVALID_DIGEST_CHARS: ("Digest must contain only alphanumeric characters (0-9, a-f)."),
|
||||
DsDataErrorCodes.INVALID_KEYTAG_SIZE: ("Key tag must be less than 65535."),
|
||||
}
|
||||
|
||||
def __init__(self, *args, code=None, **kwargs):
|
||||
|
@ -187,7 +189,7 @@ class SecurityEmailError(Exception):
|
|||
"""
|
||||
|
||||
_error_mapping = {
|
||||
SecurityEmailErrorCodes.BAD_DATA: ("Enter an email address in the required format, like name@example.com.")
|
||||
SecurityEmailErrorCodes.BAD_DATA: ("Enter an email address in the required format, " "like name@example.com."),
|
||||
}
|
||||
|
||||
def __init__(self, *args, code=None, **kwargs):
|
||||
|
|
|
@ -196,7 +196,7 @@ class DomainOrgNameAddressView(DomainFormBaseView):
|
|||
"""The form is valid, save the organization name and mailing address."""
|
||||
form.save()
|
||||
|
||||
messages.success(self.request, "The organization information has been updated.")
|
||||
messages.success(self.request, "The organization information for this domain has been updated.")
|
||||
|
||||
# superclass has the redirect
|
||||
return super().form_valid(form)
|
||||
|
@ -348,9 +348,8 @@ class DomainNameserversView(DomainFormBaseView):
|
|||
messages.success(
|
||||
self.request,
|
||||
"The name servers for this domain have been updated. "
|
||||
"Keep in mind that DNS changes may take some time to "
|
||||
"propagate across the internet. It can take anywhere "
|
||||
"from a few minutes to 48 hours for your changes to take place.",
|
||||
"Note that DNS changes could take anywhere from a few minutes to "
|
||||
"48 hours to propagate across the internet.",
|
||||
)
|
||||
|
||||
# superclass has the redirect
|
||||
|
@ -549,7 +548,7 @@ class DomainYourContactInformationView(DomainFormBaseView):
|
|||
# Post to DB using values from the form
|
||||
form.save()
|
||||
|
||||
messages.success(self.request, "Your contact information for this domain has been updated.")
|
||||
messages.success(self.request, "Your contact information has been updated.")
|
||||
|
||||
# superclass has the redirect
|
||||
return super().form_valid(form)
|
||||
|
@ -686,7 +685,7 @@ class DomainAddUserView(DomainFormBaseView):
|
|||
)
|
||||
else:
|
||||
if add_success:
|
||||
messages.success(self.request, f"Invited {email} to this domain.")
|
||||
messages.success(self.request, f"{email} has been invited to this domain.")
|
||||
|
||||
def _make_invitation(self, email_address: str, requester: User):
|
||||
"""Make a Domain invitation for this email and redirect with a message."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue