Skip to content

Commit

Permalink
Merge pull request #53 from plone/thet-zope4
Browse files Browse the repository at this point in the history
Fix bug when registering a user
  • Loading branch information
jensens committed Feb 1, 2016
2 parents dbef980 + 83310f8 commit 2f67157
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ New:

Fixes:

- *add item here*
- Fix bug when registering a user by adding a schema-setter to
UserDataPanelAdapter.
[pbauer]


2.3.4 (2015-11-28)
Expand Down
12 changes: 11 additions & 1 deletion plone/app/users/browser/userdatapanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ class UserDataPanelAdapter(AccountPanelSchemaAdapter):

@property
def schema(self):
return getUserDataSchema()
# prevent infinite recursion when accessing the schema via bypassing
# __getattr__ of self
try:
return object.__getattribute__(self, '_schema')
except AttributeError:
object.__setattr__(self, '_schema', getUserDataSchema())
return object.__getattribute__(self, '_schema')

@schema.setter
def schema(self, value):
self._schema = value

def get_email(self):
return self._getProperty('email')
Expand Down

0 comments on commit 2f67157

Please sign in to comment.