My problem is: when I submit the form it falls into the else:
block below that I have defined in my view.
What I'm trying to accomplish: allow a user to reset their password using the django 1.5 built in PasswordResetForm
functionality in django auth
Views.py
def UserResetPassword(request):
form = UserForgotPasswordForm(None, request.POST)
if request.method == 'POST':
if form.is_valid():
form.save(from_email='admin@thedomain.com',email_template_name='mysite/reuse/forgotpassword.html', use_https=False,token_generator=default_token_generator, html_email_template_name=None)
else:
return HttpResponse("Are you sure you entered that correctly?")
return render(request, 'mysite/reuse/forgotpassword.html', {
'form':form
})
Upon submitting the form it outputs: Are you sure you entered that correctly?
(e.g. the value being sent from the else:
condition
What am I doing wrong here?