authentik/passbook/admin/forms/users.py

23 lines
542 B
Python
Raw Normal View History

"""passbook administrative user forms"""
from django import forms
from passbook.admin.fields import CodeMirrorWidget, YAMLField
from passbook.core.models import User
class UserForm(forms.ModelForm):
"""Update User Details"""
class Meta:
model = User
2019-12-31 11:51:16 +00:00
fields = ["username", "name", "email", "is_staff", "is_active", "attributes"]
widgets = {
2019-12-31 11:51:16 +00:00
"name": forms.TextInput,
"attributes": CodeMirrorWidget,
}
field_classes = {
2019-12-31 11:51:16 +00:00
"attributes": YAMLField,
}