From a8d8f6fdd606cb7fee6ea7f273e3bd260954ad74 Mon Sep 17 00:00:00 2001 From: alpcentaur Date: Mon, 27 Feb 2023 17:09:29 +0000 Subject: [PATCH] made mail.adult a required field --- input/forms.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/input/forms.py b/input/forms.py index de6fc83..3a7bae9 100644 --- a/input/forms.py +++ b/input/forms.py @@ -97,10 +97,17 @@ class LiteratureForm(CheckForm): js = ('dropdown/js/base.js',) class EmailForm(CheckForm): + + # this is the code, to change required to false if needed + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields['adult'].required = True + + # TODO: add some javascript to show/hide other-field class Meta: model = Email - fields = ['domain', 'address', 'other'] + fields = ['domain', 'address', 'other', 'adult'] class Media: js = ('dropdown/js/base.js',)