Skip to content

Instantly share code, notes, and snippets.

@4heck
Created March 11, 2021 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4heck/7f462f04b181b0fb4e68ef9546072cb9 to your computer and use it in GitHub Desktop.
Save 4heck/7f462f04b181b0fb4e68ef9546072cb9 to your computer and use it in GitHub Desktop.
forgot_password_snippet.py
...
try:
user = User.objects.get(email=request.data["email"])
except User.DoesNotExist:
raise ValidationError(_("No account found with this email"))
request.user = user
send_email_forgot_password(request)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment