Fix zip code message

This commit is contained in:
zandercymatics 2023-12-11 14:25:53 -07:00
parent 6f1642eaf2
commit 7e4192178c
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 3 additions and 3 deletions

View file

@ -262,7 +262,7 @@ class OrganizationContactForm(RegistrarForm):
validators=[ validators=[
RegexValidator( RegexValidator(
"^[0-9]{5}(?:-[0-9]{4})?$|^$", "^[0-9]{5}(?:-[0-9]{4})?$|^$",
message="Enter a zip code in the form of 12345 or 12345-6789.", message="Enter a zip code in the required format, like 12345 or 12345-6789.",
) )
], ],
) )

View file

@ -239,7 +239,7 @@ class DomainOrgNameAddressForm(forms.ModelForm):
validators=[ validators=[
RegexValidator( RegexValidator(
"^[0-9]{5}(?:-[0-9]{4})?$|^$", "^[0-9]{5}(?:-[0-9]{4})?$|^$",
message="Enter a zip code in the form of 12345 or 12345-6789.", message="Enter a zip code in the required format, like 12345 or 12345-6789.",
) )
], ],
) )

View file

@ -30,7 +30,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 zip code in the form of 12345 or 12345-6789."], ["Enter a zip code in the required format, like 12345 or 12345-6789."],
) )
def test_org_contact_zip_valid(self): def test_org_contact_zip_valid(self):