Просмотр исходного кода

Force users to accept TOS.

Users are currently able to register without accepting the terms of service. The TOS is currently auto selected but a user could deselect the box and still register. This prevents a user from registering without accepting the TOS.
javaj0hn 8 лет назад
Родитель
Сommit
02b3b622ce
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      flaskbb/auth/forms.py

+ 2 - 1
flaskbb/auth/forms.py

@@ -58,7 +58,8 @@ class RegisterForm(FlaskForm):
 
     language = SelectField(_('Language'))
 
-    accept_tos = BooleanField(_("I accept the Terms of Service"), default=True)
+    accept_tos = BooleanField(_("I accept the Terms of Service"), validators=[
+        DataRequired(message=_("Please accept the TOS."))], default=True)
 
     submit = SubmitField(_("Register"))