Call Django's authenticate function with the request object#5295
Call Django's authenticate function with the request object#5295lovelydinosaur merged 1 commit intoencode:masterfrom
Conversation
|
Great stuff, thanks! Thanks again, looks good. |
|
Django 1.8.x, 1.9.x and 1.10.x releases use the following function signature: This implies that it is not possible to use positional keyword arguments with this function: I think this is also the reason why Django 1.11 introduced However, from a custom auth backend perspective I think it might fail because of this: I'll create a wrapper function in |
As of Django 1.11 the `authenticate` function accepts a request as an additional argument. This commit fixes compatibility between newer Django versions and custom authentication backends which already depend on the request object. See also: [Django 1.11 release](https://docs.djangoproject.com/en/1.11/releases/1.11/) ``` authenticate() now passes a request argument to the authenticate() method of authentication backends. Support for methods that don’t accept request as the first positional argument will be removed in Django 2.1. ```
234a0f6 to
3f0c04f
Compare
|
Milestoning for 3.7 - looks like we ought to have this in now. |
carltongibson
left a comment
There was a problem hiding this comment.
This looks great.
Description
As of Django 1.11 the
authenticatefunction accepts a request as anadditional argument. This commit fixes compatibility between newer Django
versions and custom authentication backends which already depend on the request
object.
See also:
Django 1.11 release