mirror of https://github.com/snachodog/mybuddy.git
Create all new users as superuser, for now.
This commit is contained in:
parent
29e2a4af20
commit
a4b07c054c
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue