#23155: Add request attr to user_login_failed signal -------------------------------------+------------------------------------- Reporter: anonymous | Owner: nobody Type: New feature | Status: new Component: contrib.auth | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Ready for | checkin Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by MoritzS): I think the underscore is not really necessary. It might be reasonable that some people already pass the request to `authenticate()` but I don't think it's likely that anyone would use the request keyword for anything else than the actual request. Another disadvantage for using the underscore is that if you have a backend that expects a request you'd have to write something like `authenticate(request=request, _request=request)`. I propose the request argument to be handled just like any other keyword argument, i.e. passing it along to the backend. This has following advantages: - the `authenticate(request=request, _request=request)` syntax is not needed - there won't be any backwards compatibilities regarding authentication backends because if you passed the request to `authenticate()` before, it will still be passed to the backend, and if you didn't, the backend won't get any unexpected arguments - it is still possible to provide a backwards compatibility path, if needed, by first trying to call the backend with the request and if that fails because of a `TypeError` try again without it What do you think? -- Ticket URL: <https://code.djangoproject.com/ticket/23155#comment:14> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.f79c944226b877540568ce6c7139657d%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.