[CMF-checkins] SVN: CMF/trunk/ - DCWorkflow.exportimport: Workflows managing no permissions at all

Jens Vagelpohl jens at dataflake.org
Fri Jan 27 18:49:46 EST 2006


Log message for revision 41473:
  - DCWorkflow.exportimport: Workflows managing no permissions at all 
    could make the DCWorkflow workflow exporter fail.
    (http://www.zope.org/Collectors/CMF/397)
  

Changed:
  U   CMF/trunk/DCWorkflow/exportimport.py
  U   CMF/trunk/DCWorkflow/tests/test_exportimport.py
  U   CMF/trunk/HISTORY.txt

-=-
Modified: CMF/trunk/DCWorkflow/exportimport.py
===================================================================
--- CMF/trunk/DCWorkflow/exportimport.py	2006-01-27 23:49:10 UTC (rev 41472)
+++ CMF/trunk/DCWorkflow/exportimport.py	2006-01-27 23:49:46 UTC (rev 41473)
@@ -371,16 +371,18 @@
           'acquired' -- whether roles are acquired for the permission
         """
         result = []
+        perm_roles = state.permission_roles
 
-        items = state.permission_roles.items()
-        items.sort()
+        if perm_roles:
+            items = state.permission_roles.items()
+            items.sort()
 
-        for k, v in items:
+            for k, v in items:
 
-            result.append( { 'name' : k
-                           , 'roles' : v
-                           , 'acquired' : not isinstance( v, tuple )
-                           } )
+                result.append( { 'name' : k
+                               , 'roles' : v
+                               , 'acquired' : not isinstance( v, tuple )
+                               } )
 
         return result
 

Modified: CMF/trunk/DCWorkflow/tests/test_exportimport.py
===================================================================
--- CMF/trunk/DCWorkflow/tests/test_exportimport.py	2006-01-27 23:49:10 UTC (rev 41472)
+++ CMF/trunk/DCWorkflow/tests/test_exportimport.py	2006-01-27 23:49:46 UTC (rev 41473)
@@ -122,7 +122,7 @@
                                , transitions=v[ 2 ]
                                )
             if not v[ 3 ]:
-                state.permission_roles = {}
+                state.permission_roles = None
 
             for permission, roles in v[ 3 ].items():
                 state.setPermission( permission

Modified: CMF/trunk/HISTORY.txt
===================================================================
--- CMF/trunk/HISTORY.txt	2006-01-27 23:49:10 UTC (rev 41472)
+++ CMF/trunk/HISTORY.txt	2006-01-27 23:49:46 UTC (rev 41473)
@@ -2,6 +2,10 @@
 
   Bug Fixes
 
+    - CMFSetup.workflow: Workflows managing no permissions at all could
+      make the CMFSetup workflow exporter fail.
+      (http://www.zope.org/Collectors/CMF/397)
+
     - CMFDefault.DiscussionItem: Deleting a discussion reply would not
       recurse and left items below the deleted reply still cataloged
       (http://www.zope.org/Collectors/CMF/391)



More information about the CMF-checkins mailing list