Create all new users as superuser, for now.

This commit is contained in:
Christopher Charbonneau Wells 2017-12-13 13:25:36 -05:00
parent 29e2a4af20
commit a4b07c054c
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,13 @@ class UserAddForm(UserCreationForm):
fields = ['username', 'first_name', 'last_name', 'email', fields = ['username', 'first_name', 'last_name', 'email',
'is_staff', 'is_active'] 'is_staff', 'is_active']
def save(self, commit=True):
user = super(UserAddForm, self).save(commit=False)
user.is_superuser = True
if commit:
user.save()
return user
class UserUpdateForm(forms.ModelForm): class UserUpdateForm(forms.ModelForm):
class Meta: class Meta: