Commit 533d05a3 authored by Ivan Tyagov's avatar Ivan Tyagov

Fixed some dirty code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11116 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f54f5385
......@@ -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:
......
......@@ -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:
......
......@@ -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)
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