2๐
โ
The problem was solved by :
class MyAdminPasswordChangeForm(AdminPasswordChangeForm):
def save(self, commit=True):
"""
Saves the new password.
"""
password = self.cleaned_data["password1"]
self.user.myuser.set_password(password)
if commit:
self.user.myuser.save()
return self.user.myuser
and
class ProfileAdmin(UserAdmin):
change_password_form = MyAdminPasswordChangeForm
๐คhsbr13
1๐
I ran into this error after upgrading to django 2.x. I had set up my own UserChangeForm
, so I just had to update its url:
class EmailUserChangeForm(forms.ModelForm):
password = ReadOnlyPasswordHashField(label=_("Password"), help_text=_(
"Raw passwords are not stored, so there is no way to see "
"this user's password, but you can change the password "
- "using <a href=\"password/\">this form</a>."))
+ "using <a href=\"../password/\">this form</a>."))
๐คAaron
- [Django]-Can't login to django admin account after creating super user
- [Django]-Efficient SELECT with complex WHERE condition โ do I need to store a column with the calculated value?
Source:stackexchange.com