2019-03-02 21:41:14 +00:00
|
|
|
"""passbook administrative user forms"""
|
|
|
|
|
|
|
|
from django import forms
|
|
|
|
|
2019-10-12 13:23:03 +01:00
|
|
|
from passbook.admin.fields import 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
|
2019-10-11 11:47:06 +01:00
|
|
|
fields = ['username', 'name', 'email', 'is_staff', 'is_active', 'attributes']
|
2019-03-02 21:41:14 +00:00
|
|
|
widgets = {
|
2019-10-12 13:23:03 +01:00
|
|
|
'name': forms.TextInput,
|
|
|
|
}
|
|
|
|
field_classes = {
|
|
|
|
'attributes': YAMLField,
|
2019-03-02 21:41:14 +00:00
|
|
|
}
|