diff --git a/CHANGES.rst b/CHANGES.rst index 96dbd163..01c19def 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,6 +13,7 @@ Fixed the LDAP schema update of 0.0.12 - Fixed a bug happening during RP initiated logout on clients without `post_logout_redirect_uri` defined. +- Gitlab CI fix. :pr:`64` Added ***** diff --git a/canaille/ldap_backend/ldapobject.py b/canaille/ldap_backend/ldapobject.py index 1c28531d..6b94d45c 100644 --- a/canaille/ldap_backend/ldapobject.py +++ b/canaille/ldap_backend/ldapobject.py @@ -170,7 +170,10 @@ class LDAPObject: @staticmethod def ldap_to_python(name, value): - syntax = LDAPObject.ldap_object_attributes()[name].syntax + try: + syntax = LDAPObject.ldap_object_attributes()[name].syntax + except KeyError: + return value if syntax == "1.3.6.1.4.1.1466.115.121.1.24": # Generalized Time value = value.decode("utf-8") @@ -189,7 +192,10 @@ class LDAPObject: @staticmethod def python_to_ldap(name, value): - syntax = LDAPObject.ldap_object_attributes()[name].syntax + try: + syntax = LDAPObject.ldap_object_attributes()[name].syntax + except KeyError: + return value if syntax == "1.3.6.1.4.1.1466.115.121.1.24": # Generalized Time return value.strftime("%Y%m%d%H%M%SZ").encode("utf-8")