[kupu-checkins] r38190 - kupu/trunk/kupu/plone

wiggy at codespeak.net wiggy at codespeak.net
Thu Feb 8 18:55:48 CET 2007


Author: wiggy
Date: Thu Feb  8 18:55:37 2007
New Revision: 38190

Modified:
   kupu/trunk/kupu/plone/util.py
Log:
Deal with empty transform lists. This happens during testing when the transform is removed, and later removed again when setting up the sample customisation

Modified: kupu/trunk/kupu/plone/util.py
==============================================================================
--- kupu/trunk/kupu/plone/util.py	(original)
+++ kupu/trunk/kupu/plone/util.py	Thu Feb  8 18:55:37 2007
@@ -108,6 +108,8 @@
     """Disable the UID transform: remove the policy but leave everything else intact."""
     transform_tool = getToolByName(self, 'portal_transforms')
     policies = [ (mimetype, required) for (mimetype, required) in transform_tool.listPolicies() if mimetype==MT_SAFE ]
+    if not policies:
+        return
     required = list(policies[0][1])
     if UID_TRANSFORM in required:
         required.remove(UID_TRANSFORM)


More information about the kupu-checkins mailing list