only superuser can set the superuser flag
This commit is contained in:
parent
b6705084b7
commit
f26483b41a
2 changed files with 13 additions and 13 deletions
|
@ -4,17 +4,11 @@ from django.forms.widgets import PasswordInput
|
|||
from accounts.models import *
|
||||
|
||||
|
||||
__all__ = ['UserForm', 'UserFormWithoutUsername', 'ProfileForm', 'GroupForm', 'TeamForm']
|
||||
__all__ = ['ProfileForm', 'GroupForm', 'TeamForm']
|
||||
|
||||
|
||||
user_fields=['first_name', 'last_name', 'email', 'notifications']
|
||||
|
||||
UserForm = modelform_factory(User,
|
||||
fields=['username']+user_fields+['is_superuser'])
|
||||
UserFormWithoutUsername = modelform_factory(User,
|
||||
fields=user_fields+['is_superuser'])
|
||||
ProfileForm = modelform_factory(User,
|
||||
fields=user_fields)
|
||||
fields=['first_name', 'last_name', 'email', 'notifications'])
|
||||
GroupForm = modelform_factory(Group,
|
||||
fields=['name'])
|
||||
TeamForm = modelform_factory(Team,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue