11 lines
357 B
Python
11 lines
357 B
Python
from django.contrib.auth.forms import PasswordChangeForm
|
|
|
|
|
|
class RequiredPasswordChangeForm(PasswordChangeForm):
|
|
def save(self, commit=True):
|
|
user = super().save(commit=False)
|
|
user.must_change_password = False
|
|
if commit:
|
|
user.save(update_fields=("password", "must_change_password", "updated_at"))
|
|
return user
|