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
amrani
erp5
Commits
f2e2bb05
Commit
f2e2bb05
authored
Sep 24, 2015
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Catalog: Do not forcibly pass a "query" parameter to catalog.
Likewise for positional REQUEST parameter.
parent
d3fc1558
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+6
-6
No files found.
product/ERP5Catalog/CatalogTool.py
View file @
f2e2bb05
...
@@ -667,36 +667,36 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -667,36 +667,36 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
__call__
=
searchResults
__call__
=
searchResults
security
.
declarePrivate
(
'unrestrictedSearchResults'
)
security
.
declarePrivate
(
'unrestrictedSearchResults'
)
def
unrestrictedSearchResults
(
self
,
REQUEST
=
None
,
**
kw
):
def
unrestrictedSearchResults
(
self
,
**
kw
):
"""Calls ZSQLCatalog.searchResults directly without restrictions.
"""Calls ZSQLCatalog.searchResults directly without restrictions.
"""
"""
kw
.
setdefault
(
'limit'
,
self
.
default_result_limit
)
kw
.
setdefault
(
'limit'
,
self
.
default_result_limit
)
return
ZCatalog
.
searchResults
(
self
,
REQUEST
,
**
kw
)
return
ZCatalog
.
searchResults
(
self
,
**
kw
)
# We use a string for permissions here due to circular reference in import
# We use a string for permissions here due to circular reference in import
# from ERP5Type.Permissions
# from ERP5Type.Permissions
security
.
declareProtected
(
'Search ZCatalog'
,
'getResultValue'
)
security
.
declareProtected
(
'Search ZCatalog'
,
'getResultValue'
)
def
getResultValue
(
self
,
query
=
None
,
**
kw
):
def
getResultValue
(
self
,
**
kw
):
"""
"""
A method to factor common code used to search a single
A method to factor common code used to search a single
object in the database.
object in the database.
"""
"""
kw
.
setdefault
(
'limit'
,
1
)
kw
.
setdefault
(
'limit'
,
1
)
result
=
self
.
searchResults
(
query
=
query
,
**
kw
)
result
=
self
.
searchResults
(
**
kw
)
try
:
try
:
return
result
[
0
].
getObject
()
return
result
[
0
].
getObject
()
except
IndexError
:
except
IndexError
:
return
None
return
None
security
.
declarePrivate
(
'unrestrictedGetResultValue'
)
security
.
declarePrivate
(
'unrestrictedGetResultValue'
)
def
unrestrictedGetResultValue
(
self
,
query
=
None
,
**
kw
):
def
unrestrictedGetResultValue
(
self
,
**
kw
):
"""
"""
A method to factor common code used to search a single
A method to factor common code used to search a single
object in the database. Same as getResultValue but without
object in the database. Same as getResultValue but without
taking into account security.
taking into account security.
"""
"""
kw
.
setdefault
(
'limit'
,
1
)
kw
.
setdefault
(
'limit'
,
1
)
result
=
self
.
unrestrictedSearchResults
(
query
=
query
,
**
kw
)
result
=
self
.
unrestrictedSearchResults
(
**
kw
)
try
:
try
:
return
result
[
0
].
getObject
()
return
result
[
0
].
getObject
()
except
IndexError
:
except
IndexError
:
...
...
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