Update security settings fails

Joachim Schmitz <[email protected]>
Newsgroups gmane.comp.web.zope.cps.devel
Message-ID <[email protected]>
In our portal Update security settings in portal_workflows fails with 
this traceback:
Traceback (innermost last):

     * Module ZPublisher.Publish, line 115, in publish
     * Module ZPublisher.mapply, line 88, in mapply
     * Module ZPublisher.Publish, line 41, in call_object
     * Module Products.CMFCore.WorkflowTool, line 483, in updateRoleMappings
     * Module Products.CMFCore.WorkflowTool, line 666, in 
_recursiveUpdateRoleMappings
     * Module Products.CMFCore.WorkflowTool, line 666, in 
_recursiveUpdateRoleMappings
     * Module Products.CMFCore.WorkflowTool, line 666, in 
_recursiveUpdateRoleMappings
     * Module Products.CMFCore.WorkflowTool, line 649, in 
_recursiveUpdateRoleMappings
     * Module Products.CPSWorkflow.workflow, line 268, in 
updateRoleMappingsFor
     * Module Products.CPSWorkflow.workflow, line 136, in 
updateStackDefinitionsRoleMappingsFor

TypeError: unsubscriptable object

this happens for an object of a flexible_type, which we assigned the 
section_folder_wf.

here is the diff for CPSWorkflow.workflow.py which fixes this for me:

  diff workflow.py.org workflow.py
132d131
<
135,143c134,143
<         try:
<             former_status = history[-2]
<         except IndexError:
<             # Virgin instance ;)
<             pass
<         else:
<             sflrm = former_status.get('sflrm', {})
<             for k, v in sflrm.items():
<                 wftool.updateFormerLocalRoleMappingForStack(ob, self.id,
---
 >         if history is not None:
 >             try:
 >                 former_status = history[-2]
 >             except IndexError:
 >                 # Virgin instance ;)
 >                 pass
 >             else:
 >                 sflrm = former_status.get('sflrm', {})
 >                 for k, v in sflrm.items():
 >                     wftool.updateFormerLocalRoleMappingForStack(ob, 
self.id,



-- 
Gruß Joachim



_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.