From c4ce7c41ea63aacaa546e4ad6fb84311ccf5ac36 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Tue, 12 Feb 2019 09:39:56 +0100 Subject: [PATCH] Be compatible with Flask-WTF 0.12.x --- README.md | 4 ++-- dss.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 42b30b1..e11f4a9 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ TBA * passlib >= 1.7.0 * flask >= 0.12.1 -* flask-wtf >= 0.14.2 -* ldap >= 2.4.25 +* flask-wtf >= 0.12 +* pyldap >= 2.4.25 * redis >= 2.10.5 ## uWSGI diff --git a/dss.py b/dss.py index 12ccd46..5528327 100755 --- a/dss.py +++ b/dss.py @@ -6,7 +6,7 @@ import uuid import ldap import ldap.modlist from flask import Flask, render_template, redirect, url_for, session -from flask_wtf import FlaskForm +from flask_wtf import Form from passlib.hash import ldap_salted_sha1 from redis import Redis from wtforms.fields import IntegerField, PasswordField, StringField, SubmitField @@ -31,7 +31,7 @@ class ReadOnlyField(StringField): return super(ReadOnlyField, self).__call__(*args, **kwargs) -class CreateForm(FlaskForm): +class CreateForm(Form): user = StringField('Username', validators=[DataRequired()]) uid = IntegerField('User ID', validators=[DataRequired()]) gn = StringField('Given Name', validators=[DataRequired()]) @@ -41,14 +41,14 @@ class CreateForm(FlaskForm): submit = SubmitField('Submit') -class EditForm(FlaskForm): +class EditForm(Form): user = ReadOnlyField('Username') pwd1 = PasswordField('New Password', validators=[DataRequired()]) pwd2 = PasswordField('New Password (repeat)', validators=[DataRequired(), EqualTo('pwd1', "Passwords must match")]) submit = SubmitField('Submit') -class LoginForm(FlaskForm): +class LoginForm(Form): user = StringField('Username', validators=[DataRequired()]) pswd = PasswordField('Password', validators=[DataRequired()]) submit = SubmitField('Login')