This commit is contained in:
zandercymatics 2024-04-03 15:23:02 -06:00
parent 6d13614521
commit e4c83751bf
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 48 additions and 3 deletions

View file

@ -369,7 +369,15 @@ class AuthorizingOfficialForm(RegistrarForm):
)
email = forms.EmailField(
label="Email",
max_length=254,
error_messages={"invalid": ("Enter an email address in the required format, like name@example.com.")},
# This validator should exist in the event that a preexisting field is of invalid length
validators=[
MaxLengthValidator(
254,
message="Response must be less than 254 characters.",
)
],
)
@ -566,7 +574,15 @@ class YourContactForm(RegistrarForm):
)
email = forms.EmailField(
label="Email",
max_length=254,
error_messages={"invalid": ("Enter your email address in the required format, like name@example.com.")},
# This validator should exist in the event that a preexisting field is of invalid length
validators=[
MaxLengthValidator(
254,
message="Response must be less than 254 characters.",
)
],
)
phone = PhoneNumberField(
label="Phone",
@ -621,10 +637,18 @@ class OtherContactsForm(RegistrarForm):
)
email = forms.EmailField(
label="Email",
max_length=254,
error_messages={
"required": ("Enter an email address in the required format, like name@example.com."),
"invalid": ("Enter an email address in the required format, like name@example.com."),
},
# This validator should exist in the event that a preexisting field is of invalid length
validators=[
MaxLengthValidator(
254,
message="Response must be less than 254 characters.",
)
],
)
phone = PhoneNumberField(
label="Phone",