From 79d1541e85a02ca91fdef92ea1a13d115dee69e8 Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Wed, 8 Nov 2023 17:28:44 +0100 Subject: [PATCH] Add principals to groups that already exist during import (#228) --- CHANGES.rst | 2 ++ src/collective/exportimport/import_other.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index dde62f7e..b58c8136 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,6 +12,8 @@ Changelog - Add support for ATTopic export_content [avoinea] +- Add principals to groups that already exist during import (#228) + [pbauer] 1.10 (2023-10-11) ----------------- diff --git a/src/collective/exportimport/import_other.py b/src/collective/exportimport/import_other.py index 043337a5..81182195 100644 --- a/src/collective/exportimport/import_other.py +++ b/src/collective/exportimport/import_other.py @@ -222,10 +222,10 @@ def import_groups(self, data): description=item["description"], roles=item["roles"], ) - # add all principals - for principal in item.get("principals", []): - pg.addPrincipalToGroup(principal, item["groupid"]) groupsNumber += 1 + # add all principals, even if they are not stored in plone (e.g. LDAP) + for principal in item.get("principals", []): + pg.addPrincipalToGroup(principal, item["groupid"]) return groupsNumber def import_members(self, data):