Commit aa6b7cae authored by Łukasz Nowak's avatar Łukasz Nowak

Revert "Disallow clearing catalog."

This reverts commit 4e0c2786.

Catalog clearing functionality is required.
parent 7746dd0f
...@@ -1316,7 +1316,7 @@ class Catalog(Folder, ...@@ -1316,7 +1316,7 @@ class Catalog(Folder,
'Total time: %s<br>' 'Total time: %s<br>'
'Total CPU time: %s' % (`elapse`, `c_elapse`))) 'Total CPU time: %s' % (`elapse`, `c_elapse`)))
def _allowed_manage_catalogClear(self, REQUEST=None, RESPONSE=None, def manage_catalogClear(self, REQUEST=None, RESPONSE=None,
URL1=None, sql_catalog_id=None): URL1=None, sql_catalog_id=None):
""" clears the whole enchilada """ """ clears the whole enchilada """
self.beforeCatalogClear() self.beforeCatalogClear()
...@@ -1327,16 +1327,6 @@ class Catalog(Folder, ...@@ -1327,16 +1327,6 @@ class Catalog(Folder,
RESPONSE.redirect('%s/manage_catalogAdvanced?' \ RESPONSE.redirect('%s/manage_catalogAdvanced?' \
'manage_tabs_message=Catalog%%20Cleared' % URL1) 'manage_tabs_message=Catalog%%20Cleared' % URL1)
def manage_catalogClear(self, REQUEST=None, RESPONSE=None,
URL1=None, sql_catalog_id=None):
""" Disallows clearing default catalog """
default_catalog_id = self.default_sql_catalog_id
if self.getId() == default_catalog_id or sql_catalog_id == default_catalog_id:
raise NotImplementedError("Default Catalog deletion is forbidden")
return self._allowed_manage_catalogClear(REQUEST=REQUEST,
RESPONSE=RESPONSE, URL1=URL1, sql_catalog_id=sql_catalog_id)
def manage_catalogClearReserved(self, REQUEST=None, RESPONSE=None, URL1=None): def manage_catalogClearReserved(self, REQUEST=None, RESPONSE=None, URL1=None):
""" clears reserved uids """ """ clears reserved uids """
self.clearReserved() self.clearReserved()
......
...@@ -603,7 +603,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -603,7 +603,7 @@ class ZCatalog(Folder, Persistent, Implicit):
catalog = self.getSQLCatalog(sql_catalog_id) catalog = self.getSQLCatalog(sql_catalog_id)
if catalog is not None: if catalog is not None:
catalog._allowed_manage_catalogClear(REQUEST=REQUEST, RESPONSE=RESPONSE, URL1=URL1) catalog.manage_catalogClear(REQUEST=REQUEST, RESPONSE=RESPONSE, URL1=URL1)
def manage_catalogClearReserved(self, REQUEST=None, RESPONSE=None, URL1=None, sql_catalog_id=None): def manage_catalogClearReserved(self, REQUEST=None, RESPONSE=None, URL1=None, sql_catalog_id=None):
""" clears the whole enchilada """ """ clears the whole enchilada """
......
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