2022-02-08 11:26:20 +00:00
|
|
|
from app.models import Role
|
|
|
|
from flask_wtf import FlaskForm
|
|
|
|
from wtforms import BooleanField, SelectField, SubmitField
|
2019-09-10 11:49:01 +00:00
|
|
|
|
|
|
|
|
2022-02-08 11:26:20 +00:00
|
|
|
class AdminEditUserForm(FlaskForm):
|
2019-09-10 11:49:01 +00:00
|
|
|
confirmed = BooleanField('Confirmed')
|
2022-02-08 11:26:20 +00:00
|
|
|
role = SelectField('Role')
|
|
|
|
submit = SubmitField('Submit')
|
2019-09-10 11:49:01 +00:00
|
|
|
|
2021-09-13 14:36:48 +00:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
2022-02-08 11:26:20 +00:00
|
|
|
self.role.choices = [
|
|
|
|
(role.hashid, role.name)
|
|
|
|
for role in Role.query.order_by(Role.name).all()
|
|
|
|
]
|