Updated workflow publication form
authorThierry Florac <tflorac@ulthar.net>
Sat, 09 Jun 2018 00:44:12 +0200
changeset 601 5c16e7815b69
parent 600 33811e279b1d
child 602 5f78ad6fe809
Updated workflow publication form
src/pyams_content/shared/blog/zmi/manager.py
--- a/src/pyams_content/shared/blog/zmi/manager.py	Sat Jun 09 00:07:00 2018 +0200
+++ b/src/pyams_content/shared/blog/zmi/manager.py	Sat Jun 09 00:44:12 2018 +0200
@@ -186,6 +186,6 @@
     def updateWidgets(self, prefix=None):
         super(BlogManagerWorkflowPublicationEditForm, self).updateWidgets(prefix)
         if 'publication_effective_date' in self.widgets:
-            widget = self.widgets['publication_effective_date']
-            if not widget.value:
-                widget.value = tztime(datetime.utcnow()).strftime('%d/%m/%y %H:%M')
+            pub_info = IWorkflowPublicationInfo(self.context)
+            if pub_info.publication_effective_date is None:
+                self.widgets['publication_effective_date'].value = tztime(datetime.utcnow()).strftime('%d/%m/%y %H:%M')