From 19067fe85a32a51703b7ed29626a30e00899007f Mon Sep 17 00:00:00 2001 From: Bona Fide IT GmbH <137388433+BonaFideIT@users.noreply.github.com> Date: Wed, 23 Apr 2025 14:01:19 +0200 Subject: [PATCH] Simplified UserManager.with_perm() by using get_backends(). --- django/contrib/auth/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 7be06e3d96..7c5890a00f 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -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 "