Skip to content
Snippets Groups Projects
Verified Commit 548039a6 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Handle not-existing preferences

parent fe0bed01
No related branches found
No related tags found
1 merge request!16Handle not-existing preferences
Pipeline #2646 passed
......@@ -220,7 +220,11 @@ def ldap_sync_from_user(user, dn, attrs):
setting_name = "ldap__" + setting_name_from_field(Person, field)
# Try sync if constance setting for this field is non-empty
ldap_field = get_site_preferences()[setting_name].lower()
try:
ldap_field = get_site_preferences()[setting_name].lower()
except Exception:
ldap_field = None
if ldap_field and ldap_field in attrs:
value = attrs[ldap_field][0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment