mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 19:04:18 +00:00
Check tos accepted in registration form
This commit is contained in:
parent
fc8b11fa66
commit
2c43333c94
@ -60,7 +60,11 @@ class RegistrationForm(FlaskForm):
|
||||
|
||||
def validate_username(self, field):
|
||||
if User.query.filter_by(username=field.data).first():
|
||||
raise ValidationError('Username already in use')
|
||||
raise ValidationError('Username already registered')
|
||||
|
||||
def validate_terms_of_use_accepted(self, field):
|
||||
if not field.data:
|
||||
raise ValidationError('Terms of Use not accepted')
|
||||
|
||||
|
||||
class LoginForm(FlaskForm):
|
||||
|
Loading…
Reference in New Issue
Block a user