nopaque/app/admin/forms.py

14 lines
428 B
Python
Raw Normal View History

from wtforms import BooleanField, SelectField, SubmitField
from app.forms import NopaqueForm
from app.models import Role
class AdminEditUserForm(NopaqueForm):
confirmed = BooleanField('Confirmed')
role = SelectField('Role')
submit = SubmitField('Submit')
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
2022-09-02 11:08:01 +00:00
self.role.choices = [(x.hashid, x.name) for x in Role.query.all()]