mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-06 04:27:22 +02:00
Linted
This commit is contained in:
parent
81f6e3e389
commit
44c74c7c86
3 changed files with 25 additions and 13 deletions
|
@ -778,9 +778,11 @@ OtherContactsFormSet = forms.formset_factory(
|
|||
formset=BaseOtherContactsFormSet,
|
||||
)
|
||||
|
||||
|
||||
class BaseDeletableRegistrarForm(RegistrarForm):
|
||||
"""Adds special validation and delete functionality.
|
||||
Used by forms that are tied to a Yes/No form."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.form_data_marked_for_deletion = False
|
||||
super().__init__(*args, **kwargs)
|
||||
|
@ -830,6 +832,7 @@ class BaseDeletableRegistrarForm(RegistrarForm):
|
|||
setattr(obj, name, value)
|
||||
obj.save()
|
||||
|
||||
|
||||
class NoOtherContactsForm(BaseDeletableRegistrarForm):
|
||||
no_other_contacts_rationale = forms.CharField(
|
||||
required=True,
|
||||
|
@ -845,12 +848,14 @@ class NoOtherContactsForm(BaseDeletableRegistrarForm):
|
|||
error_messages={"required": ("Rationale for no other employees is required.")},
|
||||
)
|
||||
|
||||
|
||||
class CisaRepresentativeForm(BaseDeletableRegistrarForm):
|
||||
cisa_representative_email = forms.EmailField(
|
||||
required=False,
|
||||
label="Are you working with a CISA representative?", #TODO-NL: (design check) - is this the right label?
|
||||
label="Are you working with a CISA representative?", # TODO-NL: (design check) - is this the right label?
|
||||
)
|
||||
|
||||
|
||||
class CisaRepresentativeYesNoForm(RegistrarForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Extend the initialization of the form from RegistrarForm __init__"""
|
||||
|
@ -871,7 +876,7 @@ class CisaRepresentativeYesNoForm(RegistrarForm):
|
|||
initial=initial_value,
|
||||
widget=forms.RadioSelect,
|
||||
error_messages={
|
||||
"required": "This question is required.",
|
||||
"required": "This question is required.",
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -889,6 +894,7 @@ class AdditionalDetailsForm(BaseDeletableRegistrarForm):
|
|||
],
|
||||
)
|
||||
|
||||
|
||||
class AdditionalDetailsYesNoForm(RegistrarForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Extend the initialization of the form from RegistrarForm __init__"""
|
||||
|
@ -909,10 +915,11 @@ class AdditionalDetailsYesNoForm(RegistrarForm):
|
|||
initial=initial_value,
|
||||
widget=forms.RadioSelect,
|
||||
error_messages={
|
||||
"required": "This question is required.", #TODO-NL: (design check) - is this required?
|
||||
"required": "This question is required.", # TODO-NL: (design check) - is this required?
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class RequirementsForm(RegistrarForm):
|
||||
is_policy_acknowledged = forms.BooleanField(
|
||||
label="I read and agree to the requirements for operating a .gov domain.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue