This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2019-03-02 21:41:14 +00:00
|
|
|
"""passbook administrative user forms"""
|
|
|
|
|
|
|
|
from django import forms
|
|
|
|
|
2020-05-20 11:00:45 +00:00
|
|
|
from passbook.admin.fields import CodeMirrorWidget, YAMLField
|
2019-03-02 21:41:14 +00:00
|
|
|
from passbook.core.models import User
|
|
|
|
|
|
|
|
|
|
|
|
class UserForm(forms.ModelForm):
|
|
|
|
"""Update User Details"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = User
|
2020-09-15 20:37:31 +00:00
|
|
|
fields = ["username", "name", "email", "is_active", "attributes"]
|
2019-03-02 21:41:14 +00:00
|
|
|
widgets = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"name": forms.TextInput,
|
2020-05-20 11:00:45 +00:00
|
|
|
"attributes": CodeMirrorWidget,
|
2019-10-12 12:23:03 +00:00
|
|
|
}
|
|
|
|
field_classes = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"attributes": YAMLField,
|
2019-03-02 21:41:14 +00:00
|
|
|
}
|