Browse Source

made mail.adult a required field

master
corsaronero 2 years ago
parent
commit
687fdddb8e
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      input/forms.py

+ 8
- 1
input/forms.py View File

@ -97,10 +97,17 @@ class LiteratureForm(CheckForm):
js = ('dropdown/js/base.js',) js = ('dropdown/js/base.js',)
class EmailForm(CheckForm): 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 # TODO: add some javascript to show/hide other-field
class Meta: class Meta:
model = Email model = Email
fields = ['domain', 'address', 'other']
fields = ['domain', 'address', 'other', 'adult']
class Media: class Media:
js = ('dropdown/js/base.js',) js = ('dropdown/js/base.js',)

Loading…
Cancel
Save