Skip to content

Commit

Permalink
check if principal exists before updating its properties
Browse files Browse the repository at this point in the history
  • Loading branch information
gborelli committed Feb 20, 2012
1 parent d56e355 commit f1dc562
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pas/plugins/sqlalchemy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ def getPropertiesForUser(self, user, request=None):
def doSetProperty(self, principal, name, value):
username = principal.getId()
principal = self._get_principal_by_id(username)
if not principal:
return

propmap = dict([reversed(r) for r in principal._properties])
sql_attr = propmap.get(name, None)
if sql_attr is None:
Expand Down

0 comments on commit f1dc562

Please sign in to comment.