mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-27 03:44:19 +00:00
15 lines
553 B
Python
15 lines
553 B
Python
from flask_login import current_user
|
|
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, user=current_user, *args, **kwargs):
|
|
super().__init__(*args, user=user, **kwargs)
|
|
self.role.choices = [(role.id, role.name)
|
|
for role in Role.query.order_by(Role.name).all()]
|