user password change working in admin
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from django import forms
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm, AdminPasswordChangeForm
|
||||
from django.forms import ModelForm
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
@@ -9,7 +9,6 @@ User = get_user_model()
|
||||
class CustomUserCreationForm(UserCreationForm):
|
||||
|
||||
class Meta(UserCreationForm.Meta):
|
||||
|
||||
model = User
|
||||
|
||||
UserCreationForm.Meta.fields = ('email',)
|
||||
@@ -21,7 +20,6 @@ class CustomUserChangeForm(UserChangeForm):
|
||||
|
||||
class Meta(UserChangeForm.Meta):
|
||||
model = User
|
||||
|
||||
UserChangeForm.Meta.fields = ('email',)
|
||||
fields = UserChangeForm.Meta.fields + ('full_name','role', 'notify', 'provider', 'email_verified', 'company', 'is_active', 'is_staff')
|
||||
UserChangeForm.Meta.fields = ('password1','password2',)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user