nopaque/app/admin/forms.py
2021-09-13 16:36:48 +02:00

14 lines
486 B
Python

from wtforms import BooleanField, SelectField
from ..models import Role
from ..settings.forms import EditGeneralSettingsForm
class EditGeneralSettingsAdminForm(EditGeneralSettingsForm):
confirmed = BooleanField('Confirmed')
role = SelectField('Role', coerce=int)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.role.choices = [(role.id, role.name)
for role in Role.query.order_by(Role.name).all()]