1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.10.x] Fixed #27027 -- Restored Client.force_login() defaulting to the first auth backend.

Backport of fc8f097117 from master
This commit is contained in:
Ben Demboski
2016-08-05 17:18:12 -07:00
committed by Tim Graham
parent 9f79fe756f
commit d68b145a6f
3 changed files with 25 additions and 0 deletions

View File

@@ -626,6 +626,9 @@ class Client(RequestFactory):
return False
def force_login(self, user, backend=None):
if backend is None:
backend = settings.AUTHENTICATION_BACKENDS[0]
user.backend = backend
self._login(user, backend)
def _login(self, user, backend=None):