Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
9066a142
Commit
9066a142
authored
Feb 06, 2011
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't publish acquired attributes if acquired object has no docstring.
parent
537f6512
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/ZPublisher/BaseRequest.py
src/ZPublisher/BaseRequest.py
+5
-5
src/ZPublisher/tests/testBaseRequest.py
src/ZPublisher/tests/testBaseRequest.py
+8
-0
No files found.
doc/CHANGES.rst
View file @
9066a142
...
...
@@ -10,6 +10,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed
++++++++++
- LP #713253: Prevent publication of acquired attributes, where the acquired
object does not have a docstring.
- Fix `LazyMap` to avoid unnecessary function calls.
...
...
src/ZPublisher/BaseRequest.py
View file @
9066a142
...
...
@@ -126,15 +126,15 @@ class DefaultPublishTraverse(object):
# Again, clear any error status created by __bobo_traverse__
# because we actually found something:
request
.
response
.
setStatus
(
200
)
return
subobject
except
AttributeError
:
pass
# Lastly we try with key access:
try
:
subobject
=
object
[
name
]
except
TypeError
:
# unsubscriptable
raise
KeyError
(
name
)
if
subobject
is
None
:
try
:
subobject
=
object
[
name
]
except
TypeError
:
# unsubscriptable
raise
KeyError
(
name
)
# Ensure that the object has a docstring, or that the parent
# object has a pseudo-docstring for the object. Objects that
...
...
src/ZPublisher/tests/testBaseRequest.py
View file @
9066a142
...
...
@@ -335,6 +335,14 @@ class TestBaseRequest(unittest.TestCase, BaseRequest_factory):
r
=
self
.
_makeOne
(
root
)
self
.
assertRaises
(
NotFound
,
r
.
traverse
,
'folder/objBasic/noview'
)
def
test_traverse_acquired_attribute_without_docstring
(
self
):
from
ZPublisher
import
NotFound
root
,
folder
=
self
.
_makeRootAndFolder
()
root
.
_setObject
(
'objBasic'
,
self
.
_makeObjectWithEmptyDocstring
())
r
=
self
.
_makeOne
(
root
)
self
.
assertRaises
(
NotFound
,
r
.
traverse
,
'folder/objBasic'
)
def
test_traverse_class_without_docstring
(
self
):
from
ZPublisher
import
NotFound
root
,
folder
=
self
.
_makeRootAndFolder
()
...
...
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