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
Xavier Thompson
erp5
Commits
e2c177a3
Commit
e2c177a3
authored
Jan 26, 2018
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZSQLBrain: Raise instead of returning None for unavailable objects & properties
parent
3858dcdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
16 deletions
+7
-16
product/ZSQLCatalog/Extensions/zsqlbrain.py
product/ZSQLCatalog/Extensions/zsqlbrain.py
+7
-16
No files found.
product/ZSQLCatalog/Extensions/zsqlbrain.py
View file @
e2c177a3
...
...
@@ -13,7 +13,6 @@
##############################################################################
import
Acquisition
import
sys
import
traceback
from
ZODB.POSException
import
ConflictError
from
AccessControl
import
ClassSecurityInfo
...
...
@@ -55,21 +54,13 @@ class ZSQLBrain(Acquisition.Implicit):
if
'path'
not
in
dir
(
self
)
and
'PATH'
not
in
dir
(
self
):
raise
ValueError
,
"Unable to getObject from ZSQLBrain if ZSQL Method "
\
"does not retrieves the `path` column from catalog table."
try
:
obj
=
self
.
aq_parent
.
unrestrictedTraverse
(
self
.
getPath
())
if
obj
is
None
:
if
REQUEST
is
None
:
REQUEST
=
self
.
REQUEST
obj
=
self
.
aq_parent
.
portal_catalog
.
resolve_url
(
self
.
getPath
(),
REQUEST
)
return
obj
except
ConflictError
:
raise
except
:
LOG
(
"ZCatalog WARNING"
,
0
,
"Could not access object path %s"
%
self
.
getPath
(),
error
=
sys
.
exc_info
()
)
return
None
obj
=
self
.
aq_parent
.
unrestrictedTraverse
(
self
.
getPath
())
if
obj
is
None
:
if
REQUEST
is
None
:
REQUEST
=
self
.
REQUEST
obj
=
self
.
aq_parent
.
portal_catalog
.
resolve_url
(
self
.
getPath
(),
REQUEST
)
return
obj
def
getProperty
(
self
,
name
,
d
=
_MARKER
,
**
kw
):
value
=
None
...
...
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