From a8b5a68a8c0095570c69068e33f24bb2eb35e7da Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Thu, 10 Sep 2020 11:18:41 +0200 Subject: [PATCH] dss.py: use FlaskForm instead of deprecated Form --- dss.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dss.py b/dss.py index f7197b9..25af9cd 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 Form +from flask_wtf import FlaskForm from passlib.hash import ldap_salted_sha1 from redis import Redis from wtforms.fields import IntegerField, PasswordField, StringField, SubmitField @@ -25,7 +25,7 @@ if 'LDAP_CA' in app.config.keys(): ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, app.config.get('LDAP_CA')) -class CreateForm(Form): +class CreateForm(FlaskForm): user = StringField('Username', validators=[DataRequired()]) uid = IntegerField('User ID', validators=[DataRequired()]) gn = StringField('Given Name', validators=[DataRequired()]) @@ -35,14 +35,14 @@ class CreateForm(Form): submit = SubmitField('Submit') -class EditForm(Form): +class EditForm(FlaskForm): user = StringField('Username', render_kw={'readonly': True}) pwd1 = PasswordField('New Password', validators=[DataRequired()]) pwd2 = PasswordField('New Password (repeat)', validators=[DataRequired(), EqualTo('pwd1', "Passwords must match")]) submit = SubmitField('Submit') -class LoginForm(Form): +class LoginForm(FlaskForm): user = StringField('Username', validators=[DataRequired()]) pswd = PasswordField('Password', validators=[DataRequired()]) submit = SubmitField('Login')