Bypass Django internal form rendering

The purpose of this change is to allow direct use of Django templates
to make edits to how form fields and labels are rendered, while
retaining the validation logic provided by Django's extensive field and
widget library.

This commit additional contains:
 - Remove `REQUIRED_SUFFIX`, as it is handled by the templates now
 - Remove `required=True` from form fields, as this is the default
 - Remove `required=False` from fields where it was added as workaround
   for conditionally required questions which Django form wizard
   couldn't handle
 - Replace `clean_is_policy_acknowledged` with `error_messages` dict
 - Remove duplicate nil entry for Federal Agency dropdown
 - Update `DOMAIN_REGEX` to match whole string
 - Subtle changes to `is_valid` and `get_forms` in ApplicationWizard to
   reduce database calls and use form object's initial data correctly
This commit is contained in:
Seamus Johnston 2023-02-02 14:30:00 -06:00
parent 1d6b0da391
commit 0e3f68622f
No known key found for this signature in database
GPG key ID: 2F21225985069105
42 changed files with 740 additions and 652 deletions

View file

@ -120,7 +120,6 @@ class DomainApplication(TimeStampedModel):
LEGISLATIVE = "legislative", "Legislative"
AGENCIES = [
"",
"Administrative Conference of the United States",
"Advisory Council on Historic Preservation",
"American Battle Monuments Commission",