1
0
mirror of https://github.com/moepman/bk-dss synced 2024-11-17 16:09:10 +01:00

Be compatible with Flask-WTF 0.12.x

This commit is contained in:
Markus 2019-02-12 09:39:56 +01:00
parent 41b8689033
commit c4ce7c41ea
2 changed files with 6 additions and 6 deletions

View File

@ -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

8
dss.py
View File

@ -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')