1
1
Fork 0

BRUH BUGFIXES

master
Jan Kužílek 5 years ago
parent 70797b990c
commit 64a3cef400

@ -45,6 +45,8 @@ def reset_password():
form = ResetPasswordPassForm(request.form) form = ResetPasswordPassForm(request.form)
if request.method == 'POST' and form.validate(): if request.method == 'POST' and form.validate():
user.create_password(form.password.data)
flash('Password successfully reset.') # for real flash('Password successfully reset.') # for real
return redirect(url_for('.login')) return redirect(url_for('.login'))

@ -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()]) really = BooleanField('I swear this really is my account and am not trying to steal anybody elses.', validators=[DataRequired()])
class RegisterForm(CSRFForm): 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")) email = StringField('Email', validators=[DataRequired(), Email()], render_kw=dict(placeholder="Email"))
password = PasswordField('Password', validators=[DataRequired()], render_kw=dict(placeholder="Password")) 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")) password_again = PasswordField('Repeat password', validators=[DataRequired(), EqualTo('password')], render_kw=dict(placeholder="Repeat password"))

Loading…
Cancel
Save