mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 04:12:02 +00:00
Log password change events via the password reset feature.
(imported from commit bbec7074229e8779c81d439d4eef373b5dac9fa7)
This commit is contained in:
@@ -3,9 +3,10 @@ from django.core import validators
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.contrib.auth.forms import SetPasswordForm
|
||||
|
||||
from humbug import settings
|
||||
from models import Realm
|
||||
from zephyr.models import Realm, do_change_password
|
||||
|
||||
def is_unique(value):
|
||||
try:
|
||||
@@ -48,3 +49,9 @@ class HomepageForm(forms.Form):
|
||||
else:
|
||||
validators = UniqueEmailField.default_validators + [has_valid_realm, isnt_mit]
|
||||
email = UniqueEmailField(validators=validators)
|
||||
|
||||
class LoggingSetPasswordForm(SetPasswordForm):
|
||||
def save(self, commit=True):
|
||||
do_change_password(self.user, self.cleaned_data['new_password1'],
|
||||
log=True, commit=commit)
|
||||
return self.user
|
||||
|
||||
Reference in New Issue
Block a user