diff options
Diffstat (limited to '')
-rw-r--r-- | app/views/user.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/views/user.py b/app/views/user.py index 2a8730d..9b75af8 100644 --- a/app/views/user.py +++ b/app/views/user.py @@ -14,9 +14,9 @@ mod = Blueprint('user', __name__) # Forms # class LoginForm(F.Form): - username = F.StringField(u'Username', F.req) - pwd = F.PasswordField(u'Passwort', F.req) - remember = F.BooleanField(u'Eingeloggt bleiben?') + username = F.StringField('Username', F.req) + pwd = F.PasswordField('Passwort', F.req) + remember = F.BooleanField('Eingeloggt bleiben?') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -36,13 +36,13 @@ class LoginForm(F.Form): class ChangePwdForm(F.Form): - old = F.PasswordField(u'Passwort', F.req) - new = F.PasswordField(u'Neues Passwort', F.req + [F.validators.EqualTo('confirm', u'Passwörter stimmen nicht überein')]) - confirm = F.PasswordField(u'Wdh. neues Passwort', F.req) + old = F.PasswordField('Passwort', F.req) + new = F.PasswordField('Neues Passwort', F.req + [F.validators.EqualTo('confirm', 'Passwörter stimmen nicht überein')]) + confirm = F.PasswordField('Wdh. neues Passwort', F.req) def validate_old(self, field): if not current_user.check_password(field.data): - raise F.ValidationError(u"Falsches Passwort") + raise F.ValidationError("Falsches Passwort") @property def newpwd(self): @@ -55,7 +55,7 @@ class ChangePwdForm(F.Form): @templated def login(): """Log the user in.""" - form = LoginForm(flash=u"Login fehlgeschlagen!") + form = LoginForm(flash="Login fehlgeschlagen!") if form.validate_on_submit(): login_user(form.user, remember=form.remember.data) # we explicitly need flask's variant as we redirect to a URI @@ -80,7 +80,7 @@ def cpw(): if form.validate_on_submit(): current_user.set_password(form.newpwd) db.session.commit() - flash(u"Passwort geändert.") + flash("Passwort geändert.") return redirect('index') return { 'form': form } |