mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 03:14:19 +00:00
15 lines
470 B
Python
15 lines
470 B
Python
from wtforms import BooleanField, SelectField, SubmitField
|
|
from app.forms import NopaqueForm
|
|
from app.models import Role
|
|
|
|
|
|
class UpdateUserForm(NopaqueForm):
|
|
role = SelectField('Role')
|
|
submit = SubmitField()
|
|
|
|
def __init__(self, user, *args, **kwargs):
|
|
if 'data' not in kwargs:
|
|
kwargs['data'] = {'role': user.role.hashid}
|
|
super().__init__(*args, **kwargs)
|
|
self.role.choices = [(x.hashid, x.name) for x in Role.query.all()]
|