Don't update contributors "in place" but use and update a copy of attribute
authorThierry Florac <thierry.florac@onf.fr>
Tue, 25 Jun 2019 16:25:09 +0200
changeset 1325 10f770095cec
parent 1324 b602a92324eb
child 1326 44b216760dce
Don't update contributors "in place" but use and update a copy of attribute
src/pyams_content/shared/common/zmi/owner.py
--- a/src/pyams_content/shared/common/zmi/owner.py	Tue May 28 14:35:20 2019 +0200
+++ b/src/pyams_content/shared/common/zmi/owner.py	Tue Jun 25 16:25:09 2019 +0200
@@ -103,7 +103,7 @@
             roles = IWfSharedContentRoles(version)
             previous_owner = next(iter(roles.owner))
             roles.owner = {new_owner}
-            contributors = roles.contributors
+            contributors = roles.contributors.copy()  # don't modify contributors in place!!
             if data.get('keep_owner_as_contributor'):
                 if previous_owner not in contributors:
                     contributors.add(previous_owner)