Hi Tamas,

On Apr 23, 3:25 am, Tamas Szabo <[email protected]> wrote:
> For example if I have a Token based authenticator
> (authenticate(token)) that is configured to be after my User/Password
> based authenticator (authenticate(user, password)) in settings.py the
> current code will call the user/password based authenticator and it
> will pass in the token as a username (password will be null). If I
> have an authenticator with 2 string arguments, the same will happen.

I don't think you're understanding how keyword arguments work in
Python.  Python automatically raises a TypeError if the wrong keyword
arguments are passed to a function; based on argument name, not type.
So if "username" and "password" are passed to authenticate(), your
hypothetical "authenticator with 2 string arguments" will still raise
a TypeError unless its two arguments are actually named "username" and
"password" - in which case they should be exactly what you're
expecting.  And if only "token" is passed to authenticate(), calling
the standard auth backend will raise TypeError, it won't "pass in the
token as username" at all.

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

Reply via email to