Files
timerr/apps/accounts/forms.py
T
2026-07-15 00:12:31 +05:00

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