On 05/24/2015 02:17 AM, Unai Zalakain wrote:
>> 3) Use the only configured backend, if there is only one.
>> 4) Raise ValueError("You have multiple authentication backends
>> configured; you must provide the `backend` argument to `login`.")
> 
> What about defaulting the backend argument to Django's default auth
> backend?  This way most of the sites will not need to worry about it
> while the API is maintained simple and without "magic".
>
> Those sites that use some other auth backend would need to pass it
> explicitly into the login function. If they don't do that (or, for that
> matter, if you pass an auth backend which is not present in your
> settings) they would get an error.

We can't default the `backend` argument to anything but a sentinel
value, because if it's supplied, it should take priority, but if it's
not supplied we need to maintain backwards compatibility with existing
behavior, where the `user.backend` annotation is used.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/556340C1.1020204%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to