AuthenticationForm.clean call does not have request set
|Reported by:||Jari Pennanen||Owned by:||nobody|
|Cc:||alej0varas@…, zbigniew@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I'm working on per site login system currently.
It is required to get the site of the request in prior to calling
so the calls to my auth backend should be either in form of:
authenticate(site_id, username, password)
or more general:
authenticate(request, username, password)
If I try to create own
django.contrib.auth.forms.AuthenticationForm e.g. by subclassing, then the login view never sets the
request attribute of auth form.
So currently I have to recreate whole login view and authentication form in order to make per site login. With this simple patch I could just subclass AuthenticationForm and override the
clean() functions call to authentication.
Change History (15)
comment:1 Changed 6 years ago by
|Patch needs improvement:||set|