Hook up enum

This commit is contained in:
zandercymatics 2024-01-09 12:30:23 -07:00
parent 5b2eeee547
commit 91ed4a598c
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 10 additions and 16 deletions

View file

@ -13,6 +13,7 @@ from api.views import DOMAIN_API_MESSAGES
from registrar.models import Contact, DomainApplication, DraftDomain, Domain
from registrar.templatetags.url_helpers import public_site_url
from registrar.utility import errors
from registrar.utility.enums import ValidationErrorReturnType
logger = logging.getLogger(__name__)
@ -385,7 +386,7 @@ class AlternativeDomainForm(RegistrarForm):
def clean_alternative_domain(self):
"""Validation code for domain names."""
requested = self.cleaned_data.get("alternative_domain", None)
validated = DraftDomain.validate_and_handle_errors(requested, "FORM_VALIDATION_ERROR")
validated = DraftDomain.validate_and_handle_errors(requested, ValidationErrorReturnType.FORM_VALIDATION_ERROR)
return validated
alternative_domain = forms.CharField(
@ -461,7 +462,7 @@ class DotGovDomainForm(RegistrarForm):
def clean_requested_domain(self):
"""Validation code for domain names."""
requested = self.cleaned_data.get("requested_domain", None)
validated = DraftDomain.validate_and_handle_errors(requested, "FORM_VALIDATION_ERROR")
validated = DraftDomain.validate_and_handle_errors(requested, ValidationErrorReturnType.FORM_VALIDATION_ERROR)
return validated
requested_domain = forms.CharField(label="What .gov domain do you want?")