From ccb67982ee6015819f901c273f9e4d5d6feaf7b8 Mon Sep 17 00:00:00 2001 From: Elio Schmutz Date: Wed, 27 Nov 2024 10:28:44 +0100 Subject: [PATCH] Skip None-principals when updating the local roles lookup table --- opengever/sharing/local_roles_lookup/manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opengever/sharing/local_roles_lookup/manager.py b/opengever/sharing/local_roles_lookup/manager.py index a390ce5694..a064966c16 100644 --- a/opengever/sharing/local_roles_lookup/manager.py +++ b/opengever/sharing/local_roles_lookup/manager.py @@ -69,6 +69,11 @@ def update_lookup_table(self, context): self.delete_all_by_uid(context.UID()) for principal, roles in context.get_local_roles(): + if not principal: + # It's possible that some local roles are assigned to 'None'. + # We should skip those principals. + continue + managed_roles = list(set(roles).intersection(self.MANAGED_ROLES)) if not managed_roles: continue