mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +00:00
fixes change password view
This commit is contained in:
parent
6b10e487b6
commit
ee2b656b08
2 changed files with 4 additions and 3 deletions
|
@ -384,9 +384,10 @@ class ActivityMixin(ActivitypubMixin):
|
|||
|
||||
def to_undo_activity(self):
|
||||
''' undo an action '''
|
||||
user = self.user if hasattr(self, 'user') else self.user_subject
|
||||
return activitypub.Undo(
|
||||
id='%s#undo' % self.remote_id,
|
||||
actor=self.user.remote_id,
|
||||
actor=user.remote_id,
|
||||
object=self.to_activity()
|
||||
).serialize()
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class PasswordReset(View):
|
|||
return TemplateResponse(request, 'password_reset.html', data)
|
||||
|
||||
user.set_password(new_password)
|
||||
user.save()
|
||||
user.save(broadcast=False)
|
||||
login(request, user)
|
||||
reset_code.delete()
|
||||
return redirect('/')
|
||||
|
@ -106,6 +106,6 @@ class ChangePassword(View):
|
|||
return redirect('preferences/password')
|
||||
|
||||
request.user.set_password(new_password)
|
||||
request.user.save()
|
||||
request.user.save(broadcast=False)
|
||||
login(request, request.user)
|
||||
return redirect(request.user.local_path)
|
||||
|
|
Loading…
Reference in a new issue