mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-28 13:36:30 +02:00
lowercased ZIP
This commit is contained in:
parent
bb3ceb4dea
commit
360d0d4340
7 changed files with 9 additions and 9 deletions
|
@ -458,7 +458,7 @@ class DomainOrgNameAddressForm(forms.ModelForm):
|
||||||
validators=[
|
validators=[
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
"^[0-9]{5}(?:-[0-9]{4})?$|^$",
|
"^[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.",
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -137,10 +137,10 @@ class OrganizationContactForm(RegistrarForm):
|
||||||
validators=[
|
validators=[
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
"^[0-9]{5}(?:-[0-9]{4})?$|^$",
|
"^[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(
|
urbanization = forms.CharField(
|
||||||
required=False,
|
required=False,
|
||||||
|
|
|
@ -17,7 +17,7 @@ class PortfolioOrgAddressForm(forms.ModelForm):
|
||||||
validators=[
|
validators=[
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
"^[0-9]{5}(?:-[0-9]{4})?$|^$",
|
"^[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": {
|
"state_territory": {
|
||||||
"required": "Select the state, territory, or military post where your organization is located."
|
"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 = {
|
widgets = {
|
||||||
# We need to set the required attributed for State/territory
|
# We need to set the required attributed for State/territory
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
{% input_with_errors form.state_territory %}
|
{% 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 %}
|
{% input_with_errors form.zipcode %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
{% input_with_errors forms.0.state_territory %}
|
{% 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 %}
|
{% input_with_errors forms.0.zipcode %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
{% input_with_errors form.address_line2 %}
|
{% input_with_errors form.address_line2 %}
|
||||||
{% input_with_errors form.city %}
|
{% input_with_errors form.city %}
|
||||||
{% input_with_errors form.state_territory %}
|
{% 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 %}
|
{% input_with_errors form.zipcode %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<button type="submit" class="usa-button">
|
<button type="submit" class="usa-button">
|
||||||
|
|
|
@ -33,7 +33,7 @@ class TestFormValidation(MockEppLib):
|
||||||
form = OrganizationContactForm(data={"zipcode": "nah"})
|
form = OrganizationContactForm(data={"zipcode": "nah"})
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
form.errors["zipcode"],
|
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):
|
def test_org_contact_zip_valid(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue