mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-03 09:43:33 +02:00
wip
This commit is contained in:
parent
0cada58c23
commit
55f9792b32
4 changed files with 60 additions and 4 deletions
|
@ -39,9 +39,11 @@ class RegistrarForm(forms.Form):
|
|||
|
||||
Does nothing if form is not valid.
|
||||
"""
|
||||
logger.info(f"to_database called on {self.__class__.__name__}")
|
||||
if not self.is_valid():
|
||||
return
|
||||
for name, value in self.cleaned_data.items():
|
||||
logger.info(f"{name}: {value}")
|
||||
setattr(obj, name, value)
|
||||
obj.save()
|
||||
|
||||
|
@ -547,6 +549,21 @@ class YourContactForm(RegistrarForm):
|
|||
)
|
||||
|
||||
|
||||
class OtherContactsYesNoForm(RegistrarForm):
|
||||
has_other_contacts = forms.TypedChoiceField(
|
||||
choices=(
|
||||
(True, "Yes, I can name other employees."),
|
||||
(False, "No (We'll ask you to explain why).")
|
||||
),
|
||||
widget=forms.RadioSelect
|
||||
)
|
||||
|
||||
def is_valid(self):
|
||||
val = super().is_valid()
|
||||
logger.info(f"yes no form is valid = {val}")
|
||||
return val
|
||||
|
||||
|
||||
class OtherContactsForm(RegistrarForm):
|
||||
first_name = forms.CharField(
|
||||
label="First name / given name",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue