From a1b159a575c9d69b1d94c1eea195944b3119056b Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Fri, 3 Aug 2007 09:19:06 +0000 Subject: [PATCH] Handle the case where no role is found. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15441 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Catalog/CatalogTool.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/product/ERP5Catalog/CatalogTool.py b/product/ERP5Catalog/CatalogTool.py index b88ba05ea6..8ec77f5f72 100644 --- a/product/ERP5Catalog/CatalogTool.py +++ b/product/ERP5Catalog/CatalogTool.py @@ -474,8 +474,11 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): raise DeprecationWarning, "The usage of allowedRolesAndUsers is "\ "deprecated. Please update your catalog "\ "business template." - allowedRolesAndUsers = ["'%s'" % (role, ) for role in allowedRolesAndUsers] - security_uid_list = [x.uid for x in method(security_roles_list = allowedRolesAndUsers)] + if allowedRolesAndUsers: + allowedRolesAndUsers = ["'%s'" % (role, ) for role in allowedRolesAndUsers] + security_uid_list = [x.uid for x in method(security_roles_list = allowedRolesAndUsers)] + else: + security_uid_list = [] return security_uid_list, role_column_dict security.declarePublic( 'getSecurityQuery' ) -- 2.30.9