src/pyams_content/shared/site/zmi/container.py
changeset 600 33811e279b1d
parent 591 b694d5667d17
child 730 8a9dd03f95ac
--- a/src/pyams_content/shared/site/zmi/container.py	Fri Jun 08 18:05:11 2018 +0200
+++ b/src/pyams_content/shared/site/zmi/container.py	Sat Jun 09 00:07:00 2018 +0200
@@ -137,9 +137,9 @@
     def updateWidgets(self, prefix=None):
         super(SiteContainerWorkflowPublicationEditForm, 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')
 
     def get_ajax_output(self, changes):
         output = super(self.__class__, self).get_ajax_output(changes)