mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-24 00:50:35 +00:00
Prevent password reset for inactive users
This commit is contained in:
parent
cfca806af8
commit
c399d6edfb
1 changed files with 3 additions and 1 deletions
|
@ -27,7 +27,9 @@ class PasswordResetRequest(View):
|
|||
"""create a password reset token"""
|
||||
email = request.POST.get("email")
|
||||
try:
|
||||
user = models.User.objects.get(email=email, email__isnull=False)
|
||||
user = models.User.viewer_aware_objects(request.user).get(
|
||||
email=email, email__isnull=False
|
||||
)
|
||||
except models.User.DoesNotExist:
|
||||
data = {"error": _("No user with that email address was found.")}
|
||||
return TemplateResponse(request, "password_reset_request.html", data)
|
||||
|
|
Loading…
Reference in a new issue