From 64a3cef4009a5369f7c0ef82bbbdf86ec2c50860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ku=C5=BE=C3=ADlek?= Date: Thu, 14 May 2020 22:00:20 +0200 Subject: [PATCH] BRUH BUGFIXES --- yadc/bp/auth.py | 2 ++ yadc/forms.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/yadc/bp/auth.py b/yadc/bp/auth.py index 8937ad1..a28a47a 100644 --- a/yadc/bp/auth.py +++ b/yadc/bp/auth.py @@ -45,6 +45,8 @@ def reset_password(): form = ResetPasswordPassForm(request.form) if request.method == 'POST' and form.validate(): + user.create_password(form.password.data) + flash('Password successfully reset.') # for real return redirect(url_for('.login')) diff --git a/yadc/forms.py b/yadc/forms.py index ae8f4b6..8dc284b 100644 --- a/yadc/forms.py +++ b/yadc/forms.py @@ -38,7 +38,7 @@ class ResetPasswordPassForm(ResetPasswordForm): really = BooleanField('I swear this really is my account and am not trying to steal anybody elses.', validators=[DataRequired()]) class RegisterForm(CSRFForm): - username = StringField('Username', validators=[DataRequired()], render_kw=dict(placeholder="Username")) + username = StringField('Username', validators=[DataRequired(), Regexp('^[a-zA-Z0-9\-\_\$\#]+$', message="Only letters, numbers and few special characters are supported.")], render_kw=dict(placeholder="Username")) email = StringField('Email', validators=[DataRequired(), Email()], render_kw=dict(placeholder="Email")) password = PasswordField('Password', validators=[DataRequired()], render_kw=dict(placeholder="Password")) password_again = PasswordField('Repeat password', validators=[DataRequired(), EqualTo('password')], render_kw=dict(placeholder="Repeat password"))