Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Fix silly bug in object traverser: objects that do evaluate to False
Browse files Browse the repository at this point in the history
are not neccessarily None.
  • Loading branch information
ulif committed Feb 14, 2010
1 parent 1102f82 commit e9fc069
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/grokui/admin/objectinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def traverse(self, name):
new_obj = self.obj[name]

# Try to get name as sequence entry...
if not new_obj:
if new_obj is None:
# This is not the appropriate way to handle iterators. We
# must find somehing to handle them too.
try:
Expand All @@ -315,11 +315,11 @@ def traverse(self, name):
pass

# Get name as obj attribute...
if not new_obj and hasattr(self.obj, name):
if new_obj is None and hasattr(self.obj, name):
new_obj = getattr(self.obj, name, None)

# Get name as annotation...
if not new_obj:
if new_obj is None:
naked = zope.security.proxy.removeSecurityProxy(self.obj)
try:
annotations = IAnnotations(naked)
Expand All @@ -330,7 +330,7 @@ def traverse(self, name):
pass

# Give obj a location...
if new_obj:
if new_obj is not None:
if not IPhysicallyLocatable(new_obj, False):
new_obj = location.LocationProxy(
new_obj, self.obj, name)
Expand Down

0 comments on commit e9fc069

Please sign in to comment.