Skip to content

Commit

Permalink
Don't raise a ValueError if a property doesn't exists.
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Jochum <rene@jochums.at>
  • Loading branch information
jochumdev committed May 13, 2016
1 parent f3eb8c0 commit 34d2c86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Bug fixes:
but an error.
[pcdummy]

- Don't raise an ValueError if a property doesn't exists for a ZOPE
user.
[pcdummy]


5.0.10 (2016-05-02)
-------------------
Expand Down
8 changes: 7 additions & 1 deletion src/Products/PlonePAS/tools/memberdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,13 @@ def getProperty(self, id, default=_marker):
# we won't always have PlonePAS users, due to acquisition,
# nor are guaranteed property sheets
if not sheets:
return BaseMemberData.getProperty(self, id, default)
try:
return BaseMemberData.getProperty(self, id, default)
except ValueError:
# Zope users don't have PropertySheets,
# return an empty string for them if the property
# doesn't exists.
return ''

# If we made this far, we found a PAS and some property sheets.
for sheet in sheets:
Expand Down

0 comments on commit 34d2c86

Please sign in to comment.