2022-02-08 11:26:20 +00:00
|
|
|
from wtforms import BooleanField, SelectField, SubmitField
|
2023-03-29 07:25:08 +00:00
|
|
|
from app.forms import NopaqueForm
|
|
|
|
from app.models import Role
|
2019-09-10 11:49:01 +00:00
|
|
|
|
|
|
|
|
2023-03-29 07:25:08 +00:00
|
|
|
class AdminEditUserForm(NopaqueForm):
|
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-09-02 11:08:01 +00:00
|
|
|
self.role.choices = [(x.hashid, x.name) for x in Role.query.all()]
|