On Thu, Feb 19, 2009 at 1:36 PM, jeff <jwils2...@gmail.com> wrote:

>
> OK, I know I'm missing something obvious here in my basic "Reset
> Password for Forgetful User" form:
>
> email = form.cleaned_data.get( 'email' )
> username = form.cleaned_data.get( 'username' )
> new_password = User.objects.make_random_password( length=6 )
> u = User.objects.get( username__exact=username )
> u.set_password( new_password )
> u.save
> if not u.check_password( new_password ):
>    print 'PASSWORD CHECK FAILS for ' + u.username
> u2 = auth.authenticate(username=username, password=new_password)
> if u2 is None:
>    print 'AUTHENTICATE FAILS! '
>
> When I run this and then try to login with the username and new
> password, it fails.  Adding the print statements, I find that
> check_password() works correctly, but authenticate() fails.
>
> Thanks for any help.
>
> Jeff
>
> >
> You aren't actually calling the save method on user.  save is a method so
you need to call it: user.save().

Alex


-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to