Dear Tim & All,

thanks for the hint, it works! I filed a ticket [1] and i'm also
preparing a PR. Should i send the PR against 'master' or the
'stable/1.11.x' branch?

[1] https://code.djangoproject.com/ticket/27815#ticket


Thanks, regards

Zoltan Gyarmati
https://zgyarmati.de

On 02/06/2017 11:05 PM, Tim Graham wrote:
> That looks like an oversight in the class-based view conversion [0].
> Probably LoginView() needs a get_form_kwargs() method. Would you like
> to create a ticket and provide a patch?
>
> [0]
> https://github.com/django/django/commit/78963495d0caadb77eb97ccf319ef0ba3b204fb5
>
> On Monday, February 6, 2017 at 4:12:48 PM UTC-5, Zoltan Gyarmati wrote:
>
>     Dear All,
>
>     i'm developing a multi-tenant application where it would be
>     extremely handy to have the request object in my custom
>     authentication backend available, so i went ahead and started to
>     use the /1.11a,/ version, which already has the commit:
>
>     4b9330c Fixed #25187 -- Made request available in authentication
>     backends.
>
>     I'm using the contrib.auth.views.LoginView view for my login form,
>     nothing special here, it works properly except for using the
>     'request' object in my backend's authenticate() method.
>
>       After some trials and debugging for me it seems that 'request'
>     object couldn't make its way to my authenticate() method: while
>     contrib.auth.views.LoginView still has its 'self.request' set,
>     it's not passed  to its form_class
>     'contrib.auth.forms.AuthenticationForm' (its self.request is
>     None), so when the actual authenticate() method is called from the
>     AuthenticationForm class at contrib/auth/forms.py #187, always
>     None passed as parameter 'request'.
>
>      As i'm rather new to the Django internals, i'm on uncharted
>     territory here: is it possible that it's a bug in the
>     implementation, or it's more like that i missed something obvious?
>
>     Thanks in advance, regards
>
>     -- 
>     Zoltan Gyarmati
>     https://zgyarmati.de
>
> -- 
> 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 django-developers+unsubscr...@googlegroups.com
> <mailto:django-developers+unsubscr...@googlegroups.com>.
> To post to this group, send email to
> django-developers@googlegroups.com
> <mailto:django-developers@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/00f764d0-95d4-4abb-a23e-5874f0286bb9%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/00f764d0-95d4-4abb-a23e-5874f0286bb9%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ccb7bddd-d7d4-d918-fac2-c568f84355f0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to