From 4ec82b28f77b5b66dccf495e776c02da0ef7084e Mon Sep 17 00:00:00 2001 From: Harshit Bansal Date: Wed, 16 Jan 2019 08:06:11 +0000 Subject: [PATCH] auth: Convert `get_mapped_name()` in LDAP backend to a class method. --- zproject/backends.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zproject/backends.py b/zproject/backends.py index 8791f2c5bc..6a0e448f0f 100644 --- a/zproject/backends.py +++ b/zproject/backends.py @@ -312,7 +312,8 @@ class ZulipLDAPAuthBackendBase(ZulipAuthMixin, LDAPBackend): ldap_disabled = bool(int(account_control_value) & LDAP_USER_ACCOUNT_CONTROL_DISABLED_MASK) return ldap_disabled - def get_mapped_name(self, ldap_user: _LDAPUser) -> Tuple[str, str]: + @classmethod + def get_mapped_name(cls, ldap_user: _LDAPUser) -> Tuple[str, str]: if "full_name" in settings.AUTH_LDAP_USER_ATTR_MAP: full_name_attr = settings.AUTH_LDAP_USER_ATTR_MAP["full_name"] short_name = full_name = ldap_user.attrs[full_name_attr][0]