Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
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
Show 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):
__call__
=
searchResults
security
.
declarePrivate
(
'unrestrictedSearchResults'
)
def
unrestrictedSearchResults
(
self
,
REQUEST
=
None
,
**
kw
):
def
unrestrictedSearchResults
(
self
,
**
kw
):
"""Calls ZSQLCatalog.searchResults directly without restrictions.
"""
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
# from ERP5Type.Permissions
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
object in the database.
"""
kw
.
setdefault
(
'limit'
,
1
)
result
=
self
.
searchResults
(
query
=
query
,
**
kw
)
result
=
self
.
searchResults
(
**
kw
)
try
:
return
result
[
0
].
getObject
()
except
IndexError
:
return
None
security
.
declarePrivate
(
'unrestrictedGetResultValue'
)
def
unrestrictedGetResultValue
(
self
,
query
=
None
,
**
kw
):
def
unrestrictedGetResultValue
(
self
,
**
kw
):
"""
A method to factor common code used to search a single
object in the database. Same as getResultValue but without
taking into account security.
"""
kw
.
setdefault
(
'limit'
,
1
)
result
=
self
.
unrestrictedSearchResults
(
query
=
query
,
**
kw
)
result
=
self
.
unrestrictedSearchResults
(
**
kw
)
try
:
return
result
[
0
].
getObject
()
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