Skip to content
Snippets Groups Projects
Verified Commit 04f31401 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Check if user hasattr ldap_user

parent eaf73f53
No related branches found
No related tags found
1 merge request!1Resolve "Sync user groups after login"
......@@ -9,7 +9,7 @@ def ldap_create_user(sender, instance, created, raw, using, update_fields, **kwa
Person = apps.get_model("core", "Person")
Group = apps.get_model("core", "Group")
if config.ENABLE_LDAP_SYNC and (created or config.LDAP_SYNC_ON_UPDATE):
if config.ENABLE_LDAP_SYNC and (created or config.LDAP_SYNC_ON_UPDATE) and hasattr(instance, "ldap_user"):
# Check if there is an existing person connected to the user.
if not Person.objects.filter(user=instance).exists():
if config.LDAP_MATCHING_FIELDS == "match-email":
......
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