0

I am using In-built reset password of django. Now the problem is that when i enter a email which does not exists in database, It does not give error that email does not exist

    # Reset Password
path('password-reset/',
     auth_views.PasswordResetView.as_view(
         template_name='commons/password_reset/password_reset.html'
     ),
     name='password_reset'),
path('password-reset/done/',
     auth_views.PasswordResetDoneView.as_view(
         template_name='commons/password_reset/password_reset_done.html'
     ),
     name='password_reset_done'),
path('password-reset-confirm/<uidb64>/<token>/',
     auth_views.PasswordResetConfirmView.as_view(
         template_name='commons/password_reset/password_reset_confirm.html'
     ),
     name='password_reset_confirm'),
path('password-reset-complete/',
     auth_views.PasswordResetCompleteView.as_view(
         template_name='commons/password_reset/password_reset_complete.html'
     ),
     name='password_reset_complete'),
Cipher
  • 2,060
  • 3
  • 30
  • 58
  • Possible duplicate of [Inform user that email is invalid using Django's Password Reset](https://stackoverflow.com/questions/27734185/inform-user-that-email-is-invalid-using-djangos-password-reset) – Shakil Feb 08 '19 at 11:32

1 Answers1

0

PasswordResetConfirmView method get_user() hides a number of failures, and one of them is UserModel.DoesNotExist. If you want to raise that error, you should create your own view inheriting from PasswordResetConfirmView and override get_user() there.

xbello
  • 7,223
  • 3
  • 28
  • 41