Don't use standard hard-coded form and widgets prefix
authorThierry Florac <thierry.florac@onf.fr>
Wed, 11 Apr 2018 11:44:21 +0200
changeset 65 d272d5dc4cb7
parent 64 e19b3b60f4fd
child 66 be08f81ace62
Don't use standard hard-coded form and widgets prefix
src/pyams_workflow/zmi/transition.py
--- a/src/pyams_workflow/zmi/transition.py	Wed Apr 11 11:43:39 2018 +0200
+++ b/src/pyams_workflow/zmi/transition.py	Wed Apr 11 11:44:21 2018 +0200
@@ -38,7 +38,8 @@
     def transition(self):
         parent = get_parent(self.context, IWorkflowManagedContent)
         workflow = query_utility(IWorkflow, name=parent.workflow_name)
-        return workflow.get_transition_by_id(self.request.params.get('form.widgets.transition_id'))
+        return workflow.get_transition_by_id(self.request.params.get(
+            '{0}{1}transition_id'.format(self.prefix, self.widgets.prefix)))
 
     @property
     def legend(self):
@@ -59,7 +60,8 @@
         super(WorkflowContentTransitionForm, self).updateWidgets(prefix)
         if 'transition_id' in self.widgets:
             self.widgets['transition_id'].mode = HIDDEN_MODE
-            self.widgets['transition_id'].value = self.request.params.get('form.widgets.transition_id')
+            self.widgets['transition_id'].value = self.request.params.get(
+                '{0}{1}transition_id'.format(self.prefix, self.widgets.prefix))
         if 'comment' in self.widgets:
             self.widgets['comment'].widget_css_class = 'textarea'