On Tue, Jun 2, 2009 at 9:42 AM, gsnyder2007 <gsnyder2...@gmail.com> wrote:

>
> Had the same issue and the info below allowed me to resolve the issue,
> i.e. is_valid() is now returning True on a valid username/password
> combination. Seemed to me that the key was setting the test cookie and
> assigning the POST data into the 'data' variable. The former makes
> sense to me. The latter does not. I wonder if anyone out there can
> explain why.
>

AuthenticationForm adds a 'request' (keyword or first positional) parameter
to the standard Form arguments:

http://code.djangoproject.com/browser/django/tags/releases/1.0/django/contrib/auth/forms.py#L54

So if you are instantiating an AuthenticationForm without passing in
'request' you need to specify what's normally simply the first positional
Form argument by keyword (which is 'data'), because if you pass it as simply
first positional it will be assigned to 'request'.

Not sure if that explains what does not make sense to you?

(Both the details of AuthenticationForm and the fact that the first
positional argument to the base Form class has the keyword 'data' could
probably use a bit more explicit documentation, unless I'm missing where
these things are currently covered...I couldn't find them in a brief
search.)

Karen

--~--~---------~--~----~------------~-------~--~----~
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