Don't make comment required when canceling a prepared publication
authorThierry Florac <thierry.florac@onf.fr>
Thu, 17 Jan 2019 12:41:14 +0100
changeset 1242 3599d25c7f10
parent 1241 c4a9c5e95ef5
child 1243 837612af4dc3
Don't make comment required when canceling a prepared publication
src/pyams_content/shared/common/zmi/workflow.py
--- a/src/pyams_content/shared/common/zmi/workflow.py	Thu Jan 17 12:23:11 2019 +0100
+++ b/src/pyams_content/shared/common/zmi/workflow.py	Thu Jan 17 12:41:14 2019 +0100
@@ -9,13 +9,6 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-from zope.intid import IIntIds
-from zope.lifecycleevent import ObjectModifiedEvent
-
-from pyams_content.workflow.task import ContentPublishingTask
-from pyams_scheduler.interfaces import IScheduler, IDateTaskScheduling
-from pyams_sequence.interfaces import ISequentialIdInfo
-
 
 __docformat__ = 'restructuredtext'
 
@@ -27,6 +20,7 @@
 from z3c.form.interfaces import IDataExtractedEvent
 from z3c.form.widget import FieldWidget
 from zope.interface import Interface, Invalid
+from zope.lifecycleevent import ObjectModifiedEvent
 from zope.schema import Bool
 
 from pyams_content.features.preview.interfaces import IPreviewTarget
@@ -45,15 +39,15 @@
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config
 from pyams_utils.date import format_datetime
-from pyams_utils.registry import get_utility, query_utility
+from pyams_utils.registry import get_utility
 from pyams_utils.text import text_to_html
-from pyams_utils.timezone import tztime, gmtime
+from pyams_utils.timezone import gmtime, tztime
 from pyams_utils.traversing import get_parent
 from pyams_utils.url import absolute_url
 from pyams_viewlet.viewlet import Viewlet, viewlet_config
-from pyams_workflow.interfaces import IWorkflow, IWorkflowCommentInfo, IWorkflowInfo, IWorkflowPublicationInfo, \
-    IWorkflowRequestUrgencyInfo, IWorkflowState, IWorkflowStateLabel, IWorkflowTransitionInfo, IWorkflowVersions, \
-    MANUAL, SYSTEM, NoTransitionAvailableError, AmbiguousTransitionError
+from pyams_workflow.interfaces import AmbiguousTransitionError, IWorkflow, IWorkflowCommentInfo, IWorkflowInfo, \
+    IWorkflowPublicationInfo, IWorkflowRequestUrgencyInfo, IWorkflowState, IWorkflowStateLabel, IWorkflowTransitionInfo, \
+    IWorkflowVersions, MANUAL, SYSTEM
 from pyams_workflow.zmi.transition import WorkflowContentTransitionForm
 from pyams_zmi.form import InnerAdminAddForm
 
@@ -424,11 +418,6 @@
              field.Fields(IWorkflowCommentInfo)
     buttons = button.Buttons(IPublicationCancelButtons)
 
-    def updateWidgets(self, prefix=None):
-        super(PublicationCancelForm, self).updateWidgets(prefix)
-        if 'comment' in self.widgets:
-            self.widgets['comment'].required = True
-
 
 @subscriber(IDataExtractedEvent, form_selector=PublicationCancelForm)
 def handle_publication_cancel_form_data_extraction(event):