fix: crash when LDAP groups are refering to unexisting users

This commit is contained in:
Éloi Rivard 2023-11-28 09:37:37 +01:00
parent cba95cf666
commit d9dbd8ad0e
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
2 changed files with 6 additions and 1 deletions

View file

@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
Fixed
*****
- Avoid crashing when LDAP groups references unexisting users.
[0.0.35] - 2023-11-25
=====================

View file

@ -75,7 +75,7 @@ def python_to_ldap(value, syntax, encode=True):
value = "TRUE" if value else "FALSE"
if syntax == Syntax.DISTINGUISHED_NAME:
value = value.id
value = value.id if value else None
if not value:
return None