From 2a781c228f6a0ae65e94534a5603768583b1426c Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Tue, 15 Oct 2024 10:43:45 +0800 Subject: [PATCH] perf: Cas user cannot bind organization --- apps/users/signal_handlers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/users/signal_handlers.py b/apps/users/signal_handlers.py index b8fb37085..2f5f34e86 100644 --- a/apps/users/signal_handlers.py +++ b/apps/users/signal_handlers.py @@ -53,10 +53,11 @@ def user_authenticated_handle(user, created, source, attrs=None, **kwargs): user.source = source user.save() - if created and isinstance(attrs, dict): + if created: org_ids = bind_user_to_org_role(user) - group_names = attrs.get('groups') - bind_user_to_group(org_ids, group_names, user) + if isinstance(attrs, dict): + group_names = attrs.get('groups') + bind_user_to_group(org_ids, group_names, user) if not attrs: return