fix: LDAP backend rdn_value could try to strip a None value

This commit is contained in:
Éloi Rivard 2024-07-25 17:39:40 +02:00
parent 67d2338a90
commit 35fab7d321
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184

View file

@ -138,7 +138,8 @@ class LDAPObject(BackendModel, metaclass=LDAPObjectMetaclass):
@property
def rdn_value(self):
value = self.get_ldap_attribute(self.rdn_attribute)
return (value[0] if isinstance(value, list) else value).strip()
rdn_value = value[0] if isinstance(value, list) else value
return rdn_value.strip() if rdn_value else rdn_value
@property
def dn(self):