nopaque/app/admin/forms.py
2022-11-24 12:24:29 +01:00

14 lines
424 B
Python

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 = [(x.hashid, x.name) for x in Role.query.all()]