-
Patrick Jentsch authored
Use enums where appropriate. This commit includes new migrations that are NOT compatible with older nopaque instances
Patrick Jentsch authoredUse enums where appropriate. This commit includes new migrations that are NOT compatible with older nopaque instances
forms.py 487 B
from app.models import Role
from flask_wtf import FlaskForm
from wtforms import BooleanField, SelectField, SubmitField
class AdminEditUserForm(FlaskForm):
confirmed = BooleanField('Confirmed')
role = SelectField('Role')
submit = SubmitField('Submit')
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.role.choices = [
(role.hashid, role.name)
for role in Role.query.order_by(Role.name).all()
]