mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-06 20:45:36 +02:00
Fix max length bug
This commit is contained in:
parent
1e4be56e8e
commit
6728826c0b
3 changed files with 6 additions and 11 deletions
|
@ -33,6 +33,7 @@ class DomainAddUserForm(forms.Form):
|
|||
|
||||
email = forms.EmailField(
|
||||
label="Email",
|
||||
max_length=None,
|
||||
error_messages={"invalid": ("Enter your email address in the required format, like name@example.com.")},
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
|
@ -300,6 +301,7 @@ class DomainSecurityEmailForm(forms.Form):
|
|||
|
||||
security_email = forms.EmailField(
|
||||
label="Security email (optional)",
|
||||
max_length=None,
|
||||
required=False,
|
||||
error_messages={
|
||||
"invalid": str(SecurityEmailError(code=SecurityEmailErrorCodes.BAD_DATA)),
|
||||
|
|
|
@ -369,6 +369,7 @@ class AuthorizingOfficialForm(RegistrarForm):
|
|||
)
|
||||
email = forms.EmailField(
|
||||
label="Email",
|
||||
max_length=None,
|
||||
error_messages={"invalid": ("Enter an email address in the required format, like name@example.com.")},
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
|
@ -572,6 +573,7 @@ class YourContactForm(RegistrarForm):
|
|||
)
|
||||
email = forms.EmailField(
|
||||
label="Email",
|
||||
max_length=None,
|
||||
error_messages={"invalid": ("Enter your email address in the required format, like name@example.com.")},
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
|
@ -633,6 +635,7 @@ class OtherContactsForm(RegistrarForm):
|
|||
)
|
||||
email = forms.EmailField(
|
||||
label="Email",
|
||||
max_length=None,
|
||||
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."),
|
||||
|
|
|
@ -79,17 +79,7 @@ error messages, if necessary.
|
|||
{% if widget.attrs.maxlength %}
|
||||
<span
|
||||
id="{{ widget.attrs.id }}__message"
|
||||
{% comment %}
|
||||
Many USWDS scripts actually rely on this field existing when using maxlength (even when implied).
|
||||
Without it, our javascript breaks as the base script they are using has poor error handling.
|
||||
To maintain consistency and to avoid doing massive overrides, we can just simply hide this field.
|
||||
|
||||
This is a workaround but I would argue the tradeoff here makes sense.
|
||||
{% endcomment %}
|
||||
{% if not show_max_length %}
|
||||
aria-hidden="true"
|
||||
{% endif %}
|
||||
class="usa-character-count__message {% if not show_max_length %} display-none {% endif %}"
|
||||
class="usa-character-count__message"
|
||||
aria-live="polite"
|
||||
>
|
||||
You can enter up to {{ widget.attrs.maxlength }} characters
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue