Terms of use confirmation

This commit is contained in:
Inga Kirschnick
2023-04-13 16:08:07 +02:00
parent 144bb38d75
commit 8538fc705f
10 changed files with 198 additions and 2 deletions

View File

@ -43,6 +43,10 @@ class RegistrationForm(FlaskForm):
EqualTo('password', message='Passwords must match')
]
)
terms_of_use_accepted = BooleanField(
'I have read and accept the terms of use',
validators=[InputRequired()]
)
submit = SubmitField()
def __init__(self, *args, **kwargs):

View File

@ -40,7 +40,8 @@ def register():
user = User.create(
email=form.email.data.lower(),
password=form.password.data,
username=form.username.data
username=form.username.data,
terms_of_use_accepted=form.terms_of_use_accepted.data
)
except OSError:
flash('Internal Server Error', category='error')