[Erp5-report] r10352 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Sep 27 12:20:11 CEST 2006


Author: jerome
Date: Wed Sep 27 12:19:59 2006
New Revision: 10352

URL: http://svn.erp5.org?rev=10352&view=rev
Log:
remove try: except: in ERP5Site_getModuleItemList


Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml?rev=10352&r1=10351&r2=10352&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml Wed Sep 27 12:19:59 2006
@@ -68,32 +68,21 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>from Products.ERP5Type.Cache import CachingMethod, clearCache\n
-from ZODB.POSException import ConflictError\n
+            <value> <string>from Products.ERP5Type.Cache import CachingMethod\n
 \n
-user = context.portal_membership.getAuthenticatedMember()\n
-\n
+user = context.portal_membership.getAuthenticatedMember().getUserName()\n
 portal = context.getPortalObject()\n
 \n
 def getModuleItemList(user=None, portal_path=None):\n
   gettext = context.Localizer.erp5_ui.gettext\n
   item_list = []\n
-  try :\n
-    for module_id in portal.objectIds(\'ERP5 Folder\'):\n
-      try:\n
-        module = portal[module_id]\n
-        if user.has_permission(\'View\', module):\n
-          url = module.getPath()\n
-          label = module.getTitleOrId()\n
-          label = gettext(label)\n
-          item_list.append((label, url))\n
-      except ConflictError : raise\n
-      except: pass\n
-  except ConflictError : raise\n
-  except: pass\n
+  for module_id in portal.objectIds(spec=(\'ERP5 Folder\',)):\n
+    module = portal.restrictedTraverse(module_id, None)\n
+    if module is not None:\n
+      if portal.portal_membership.checkPermission(\'View\', module):\n
+        item_list.append((gettext(module.getTitleOrId()), module.getPath()))\n
 \n
-  def compareModules(a, b): return cmp(a[0], b[0])\n
-  item_list.sort(compareModules)\n
+  item_list.sort(lambda a, b:cmp(a[0], b[0]))\n
   return item_list\n
 \n
 getModuleItemList = CachingMethod(getModuleItemList, id=\'ERP5Site_getModuleItemList\')\n
@@ -109,6 +98,12 @@
         </item>
         <item>
             <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
             <value>
               <none/>
             </value>
@@ -143,9 +138,6 @@
                           <tuple>
                             <string>Products.ERP5Type.Cache</string>
                             <string>CachingMethod</string>
-                            <string>clearCache</string>
-                            <string>ZODB.POSException</string>
-                            <string>ConflictError</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>user</string>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=10352&r1=10351&r2=10352&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Wed Sep 27 12:19:59 2006
@@ -1,1 +1,1 @@
-80
+81




More information about the Erp5-report mailing list