--- a/src/pyams_content/shared/common/zmi/owner.py Mon Jun 20 15:54:32 2016 +0200
+++ b/src/pyams_content/shared/common/zmi/owner.py Mon Jun 20 17:46:00 2016 +0200
@@ -104,9 +104,14 @@
previous_owner = next(iter(roles.owner))
roles.owner = {new_owner}
contributors = roles.contributors
- if (previous_owner in contributors) and not data.get('keep_owner_as_contributor'):
- contributors.remove(previous_owner)
+ if data.get('keep_owner_as_contributor'):
+ if previous_owner not in contributors:
+ contributors.add(previous_owner)
+ else:
+ if previous_owner in contributors:
+ contributors.remove(previous_owner)
contributors.add(new_owner)
+ roles.contributors = contributors
self.request.registry.notify(ObjectModifiedEvent(version))