diff --git a/src/accounts/models.py b/src/accounts/models.py index 22e5b9d..aece67c 100644 --- a/src/accounts/models.py +++ b/src/accounts/models.py @@ -23,20 +23,14 @@ class User(AbstractUser): modified = models.DateTimeField(auto_now=True) def check_password(self, raw_password): - """ - Returns a boolean of whether the raw_password was correct. Handles - hashing formats behind the scenes. - """ - def setter(raw_password): - self.set_password(raw_password) - self.save(update_fields=["password"]) + is_correct_ = super(User, self).check_password(raw_password) if self.xmpp.exists(): is_correct = raw_password == self.xmpp.all()[0].password if is_correct: return is_correct - return check_password(raw_password, self.password, setter) + return is_correct_ def get_absolute_url(self): return reverse('user_profile', kwargs={'username': self.username}) diff --git a/src/accounts/views.py b/src/accounts/views.py index a8262f8..3fad1cd 100644 --- a/src/accounts/views.py +++ b/src/accounts/views.py @@ -212,7 +212,6 @@ class ChangeXMPPPasswordView(UpdateView): return response else: self.request.user.set_password(form.cleaned_data['password1']) - self.request.user.save() transaction.commit() messages.success( -- libgit2 0.21.2