This commit is contained in:
zandercymatics 2024-04-03 15:26:05 -06:00
parent e4c83751bf
commit 3e24166cfb
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 2 additions and 16 deletions

View file

@ -2,7 +2,7 @@
import logging import logging
from django import forms from django import forms
from django.core.validators import MinValueValidator, MaxValueValidator, RegexValidator from django.core.validators import MinValueValidator, MaxValueValidator, RegexValidator, MaxLengthValidator
from django.forms import formset_factory from django.forms import formset_factory
from registrar.models import DomainRequest from registrar.models import DomainRequest
from phonenumber_field.widgets import RegionalPhoneNumberWidget from phonenumber_field.widgets import RegionalPhoneNumberWidget
@ -15,7 +15,7 @@ from registrar.utility.errors import (
SecurityEmailError, SecurityEmailError,
SecurityEmailErrorCodes, SecurityEmailErrorCodes,
) )
from django.core.validators import RegexValidator, MaxLengthValidator
from ..models import Contact, DomainInformation, Domain from ..models import Contact, DomainInformation, Domain
from .common import ( from .common import (
ALGORITHM_CHOICES, ALGORITHM_CHOICES,
@ -204,8 +204,6 @@ class ContactForm(forms.ModelForm):
# take off maxlength attribute for the phone number field # take off maxlength attribute for the phone number field
# which interferes with out input_with_errors template tag # which interferes with out input_with_errors template tag
self.fields["phone"].widget.attrs.pop("maxlength", None) self.fields["phone"].widget.attrs.pop("maxlength", None)
max = self.fields["email"].widget.attrs["maxlength"]
print(f"what is the max? {max}")
for field_name in self.required: for field_name in self.required:
self.fields[field_name].required = True self.fields[field_name].required = True

View file

@ -75,15 +75,3 @@ error messages, if necessary.
{% else %} {% else %}
</div> </div>
{% endif %} {% endif %}
{% if widget.attrs.maxlength and show_max_length %}
<span
id="{{ widget.attrs.id }}__message"
class="usa-character-count__message"
aria-live="polite"
>
You can enter up to {{ widget.attrs.maxlength }} characters
</span>
</div>
{% endif %}