Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
4e0c2786
Commit
4e0c2786
authored
Oct 31, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disallow clearing catalog.
parent
d58ffc5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+11
-1
product/ZSQLCatalog/ZSQLCatalog.py
product/ZSQLCatalog/ZSQLCatalog.py
+1
-1
No files found.
product/ZSQLCatalog/SQLCatalog.py
View file @
4e0c2786
...
...
@@ -1316,7 +1316,7 @@ class Catalog(Folder,
'Total time: %s<br>'
'Total CPU time: %s'
%
(
`elapse`
,
`c_elapse`
)))
def
manage_catalogClear
(
self
,
REQUEST
=
None
,
RESPONSE
=
None
,
def
_allowed_
manage_catalogClear
(
self
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
,
sql_catalog_id
=
None
):
""" clears the whole enchilada """
self
.
beforeCatalogClear
()
...
...
@@ -1327,6 +1327,16 @@ class Catalog(Folder,
RESPONSE
.
redirect
(
'%s/manage_catalogAdvanced?'
\
'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
):
""" clears reserved uids """
self
.
clearReserved
()
...
...
product/ZSQLCatalog/ZSQLCatalog.py
View file @
4e0c2786
...
...
@@ -603,7 +603,7 @@ class ZCatalog(Folder, Persistent, Implicit):
catalog
=
self
.
getSQLCatalog
(
sql_catalog_id
)
if
catalog
is
not
None
:
catalog
.
manage_catalogClear
(
REQUEST
=
REQUEST
,
RESPONSE
=
RESPONSE
,
URL1
=
URL1
)
catalog
.
_allowed_
manage_catalogClear
(
REQUEST
=
REQUEST
,
RESPONSE
=
RESPONSE
,
URL1
=
URL1
)
def
manage_catalogClearReserved
(
self
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
,
sql_catalog_id
=
None
):
""" clears the whole enchilada """
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment