mirror of
https://github.com/django/django.git
synced 2025-06-08 21:19:13 +00:00
Simplified UserManager.with_perm() by using get_backends().
This commit is contained in:
parent
1bc805e23b
commit
19067fe85a
@ -215,9 +215,9 @@ class UserManager(BaseUserManager):
|
||||
self, perm, is_active=True, include_superusers=True, backend=None, obj=None
|
||||
):
|
||||
if backend is None:
|
||||
backends = auth._get_backends(return_tuples=True)
|
||||
backends = auth.get_backends()
|
||||
if len(backends) == 1:
|
||||
backend, _ = backends[0]
|
||||
backend = backends[0]
|
||||
else:
|
||||
raise ValueError(
|
||||
"You have multiple authentication backends configured and "
|
||||
|
Loading…
x
Reference in New Issue
Block a user