From 533d05a3e9162664c69a8830d424a0713ff0584d Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Mon, 6 Nov 2006 12:21:07 +0000 Subject: [PATCH] Fixed some dirty code. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11116 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/CachePlugins/DistributedRamCache.py | 2 +- product/ERP5Type/CachePlugins/SQLCache.py | 2 +- product/ERP5Type/Tool/CacheTool.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/product/ERP5Type/CachePlugins/DistributedRamCache.py b/product/ERP5Type/CachePlugins/DistributedRamCache.py index f505a17ff8..ccfef48b34 100644 --- a/product/ERP5Type/CachePlugins/DistributedRamCache.py +++ b/product/ERP5Type/CachePlugins/DistributedRamCache.py @@ -63,7 +63,7 @@ class DistributedRamCache(BaseCache): except ImportError: request = None - if request: + if request is not None: ## Zope/ERP5 environment memcache_conn = request.get('_erp5_memcache_connection', None) if not memcache_conn: diff --git a/product/ERP5Type/CachePlugins/SQLCache.py b/product/ERP5Type/CachePlugins/SQLCache.py index e1e6e5c329..5bf9e1da37 100644 --- a/product/ERP5Type/CachePlugins/SQLCache.py +++ b/product/ERP5Type/CachePlugins/SQLCache.py @@ -124,7 +124,7 @@ class SQLCache(BaseCache): except ImportError: request = None - if request: + if request is not None: ## Zope/ERP5 environment dbConn = request.get('_erp5_dbcache_connection', None) if not dbConn: diff --git a/product/ERP5Type/Tool/CacheTool.py b/product/ERP5Type/Tool/CacheTool.py index b3c16dbb0d..91565632ee 100644 --- a/product/ERP5Type/Tool/CacheTool.py +++ b/product/ERP5Type/Tool/CacheTool.py @@ -110,7 +110,7 @@ class CacheTool(BaseTool): except: pass self.erp5_sql_transactionless_connection.manage_test(my_query) - if REQUEST: + if REQUEST is not None: self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache table successfully created.') security.declareProtected(Permissions.AccessContentsInformation, 'parseDBConnectionString') @@ -169,7 +169,7 @@ class CacheTool(BaseTool): for key,item in self.getCacheFactoryList().items(): if len(item['cache_plugins'])!=0: CachingMethod.factories[key] = CacheFactory(item['cache_plugins'], item['cache_params']) - if REQUEST: + if REQUEST is not None: self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache updated.') security.declareProtected(Permissions.ModifyPortalContent, 'clearCache') @@ -179,7 +179,7 @@ class CacheTool(BaseTool): for cf in ram_cache_root: for cp in ram_cache_root[cf].getCachePluginList(): cp.clearCache() - if REQUEST: + if REQUEST is not None: self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache cleared.') security.declareProtected(Permissions.ModifyPortalContent, 'clearCacheFactory') @@ -188,7 +188,7 @@ class CacheTool(BaseTool): ram_cache_root = self.getRamCacheRoot() if ram_cache_root.has_key(cache_factory_id): ram_cache_root[cache_factory_id].clearCache() - if REQUEST: + if REQUEST is not None: self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache factory %s cleared.' %cache_factory_id) security.declareProtected(Permissions.ModifyPortalContent, 'clearCacheFactoryScope') @@ -197,6 +197,6 @@ class CacheTool(BaseTool): ram_cache_root = self.getRamCacheRoot() if ram_cache_root.has_key(cache_factory_id): ram_cache_root[cache_factory_id].clearCacheForScope(scope) - if REQUEST: + if REQUEST is not None: self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache factory scope %s cleared.' %cache_factory_id) -- 2.30.9