lowercased ZIP

This commit is contained in:
David Kennedy 2024-10-03 12:21:05 -04:00
parent bb3ceb4dea
commit 360d0d4340
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
7 changed files with 9 additions and 9 deletions

View file

@ -458,7 +458,7 @@ class DomainOrgNameAddressForm(forms.ModelForm):
validators=[
RegexValidator(
"^[0-9]{5}(?:-[0-9]{4})?$|^$",
message="Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789.",
message="Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789.",
)
],
)

View file

@ -137,10 +137,10 @@ class OrganizationContactForm(RegistrarForm):
validators=[
RegexValidator(
"^[0-9]{5}(?:-[0-9]{4})?$|^$",
message="Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789.",
message="Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789.",
)
],
error_messages={"required": ("Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789.")},
error_messages={"required": ("Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789.")},
)
urbanization = forms.CharField(
required=False,

View file

@ -17,7 +17,7 @@ class PortfolioOrgAddressForm(forms.ModelForm):
validators=[
RegexValidator(
"^[0-9]{5}(?:-[0-9]{4})?$|^$",
message="Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789.",
message="Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789.",
)
],
)
@ -38,7 +38,7 @@ class PortfolioOrgAddressForm(forms.ModelForm):
"state_territory": {
"required": "Select the state, territory, or military post where your organization is located."
},
"zipcode": {"required": "Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789."},
"zipcode": {"required": "Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789."},
}
widgets = {
# We need to set the required attributed for State/territory

View file

@ -42,7 +42,7 @@
{% input_with_errors form.state_territory %}
{% with add_class="usa-input--small" sublabel_text="Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789." %}
{% with add_class="usa-input--small" sublabel_text="Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789." %}
{% input_with_errors form.zipcode %}
{% endwith %}

View file

@ -33,7 +33,7 @@
{% input_with_errors forms.0.state_territory %}
{% with add_class="usa-input--small" sublabel_text="Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789." %}
{% with add_class="usa-input--small" sublabel_text="Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789." %}
{% input_with_errors forms.0.zipcode %}
{% endwith %}

View file

@ -45,7 +45,7 @@
{% input_with_errors form.address_line2 %}
{% input_with_errors form.city %}
{% input_with_errors form.state_territory %}
{% with add_class="usa-input--small" sublabel_text="Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789." %}
{% with add_class="usa-input--small" sublabel_text="Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789." %}
{% input_with_errors form.zipcode %}
{% endwith %}
<button type="submit" class="usa-button">

View file

@ -33,7 +33,7 @@ class TestFormValidation(MockEppLib):
form = OrganizationContactForm(data={"zipcode": "nah"})
self.assertEqual(
form.errors["zipcode"],
["Enter a 5-digit or 9-digit ZIP code, like 12345 or 12345-6789."],
["Enter a 5-digit or 9-digit zip code, like 12345 or 12345-6789."],
)
def test_org_contact_zip_valid(self):