Commit b0fda33a authored by Jérome Perrin's avatar Jérome Perrin

remove try: except: in ERP5Site_getModuleItemList



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10352 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e8820662
...@@ -68,32 +68,21 @@ ...@@ -68,32 +68,21 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Cache import CachingMethod, clearCache\n <value> <string>from Products.ERP5Type.Cache import CachingMethod\n
from ZODB.POSException import ConflictError\n
\n
user = context.portal_membership.getAuthenticatedMember()\n
\n \n
user = context.portal_membership.getAuthenticatedMember().getUserName()\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
def getModuleItemList(user=None, portal_path=None):\n def getModuleItemList(user=None, portal_path=None):\n
gettext = context.Localizer.erp5_ui.gettext\n gettext = context.Localizer.erp5_ui.gettext\n
item_list = []\n item_list = []\n
try :\n for module_id in portal.objectIds(spec=(\'ERP5 Folder\',)):\n
for module_id in portal.objectIds(\'ERP5 Folder\'):\n module = portal.restrictedTraverse(module_id, None)\n
try:\n if module is not None:\n
module = portal[module_id]\n if portal.portal_membership.checkPermission(\'View\', module):\n
if user.has_permission(\'View\', module):\n item_list.append((gettext(module.getTitleOrId()), module.getPath()))\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
\n \n
def compareModules(a, b): return cmp(a[0], b[0])\n item_list.sort(lambda a, b:cmp(a[0], b[0]))\n
item_list.sort(compareModules)\n
return item_list\n return item_list\n
\n \n
getModuleItemList = CachingMethod(getModuleItemList, id=\'ERP5Site_getModuleItemList\')\n getModuleItemList = CachingMethod(getModuleItemList, id=\'ERP5Site_getModuleItemList\')\n
...@@ -113,6 +102,12 @@ return getModuleItemList(user=user, portal_path=portal_path)\n ...@@ -113,6 +102,12 @@ return getModuleItemList(user=user, portal_path=portal_path)\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -143,9 +138,6 @@ return getModuleItemList(user=user, portal_path=portal_path)\n ...@@ -143,9 +138,6 @@ return getModuleItemList(user=user, portal_path=portal_path)\n
<tuple> <tuple>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>clearCache</string>
<string>ZODB.POSException</string>
<string>ConflictError</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>user</string> <string>user</string>
......
80 81
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment