mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-03 01:33:32 +02:00
Return tuple and do error mapping
This commit is contained in:
parent
6b6aed8f24
commit
ce361cdd3b
3 changed files with 25 additions and 30 deletions
|
@ -383,7 +383,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(
|
||||
validated, _ = DraftDomain.validate_and_handle_errors(
|
||||
requested, ValidationErrorReturnType.FORM_VALIDATION_ERROR, blank_ok=True
|
||||
)
|
||||
return validated
|
||||
|
@ -461,7 +461,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, ValidationErrorReturnType.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?")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue