use separate Form for Admin user editing (allow is_staff and is_active)

This commit is contained in:
Jens Langhammer
2019-03-02 22:41:14 +01:00
parent 01a9520140
commit e88a82553d
2 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,17 @@
"""passbook administrative user forms"""
from django import forms
from passbook.core.models import User
class UserForm(forms.ModelForm):
"""Update User Details"""
class Meta:
model = User
fields = ['username', 'name', 'email', 'is_staff', 'is_active']
widgets = {
'name': forms.TextInput
}