Updated workflow publication interface
authorThierry Florac <thierry.florac@onf.fr>
Mon, 18 Jan 2016 17:44:37 +0100 (2016-01-18)
changeset 18 4c1e7b57e124
parent 17 eb468be7c127
child 19 25e455568b00
Updated workflow publication interface
src/pyams_content/workflow/__init__.py
--- a/src/pyams_content/workflow/__init__.py	Mon Jan 18 17:44:04 2016 +0100
+++ b/src/pyams_content/workflow/__init__.py	Mon Jan 18 17:44:37 2016 +0100
@@ -183,13 +183,14 @@
     """Publish version"""
     request = check_request()
     translate = request.localizer.translate
-    IWorkflowPublicationInfo(context).publication_date = datetime.utcnow()
+    publication_info = IWorkflowPublicationInfo(context)
+    publication_info.publication_date = datetime.utcnow()
+    publication_info.publisher = request.principal.id
     version_id = IWorkflowState(context).version_id
     for version in IWorkflowVersions(context).get_versions((PUBLISHED, RETIRING, RETIRED, ARCHIVING)):
         if version is not context:
             IWorkflowInfo(version).fire_transition_toward('archived',
                                                           comment=translate(_("Published version {0}")).format(version_id))
-    IWfSharedContent(context).publisher = request.principal.id
 
 
 def archive_action(wf, context):