fix dumb name error causing error when non managers try to change his properties stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 15 Feb 2010 15:05:15 +0100
branchstable
changeset 4569 1acd90d0cb59
parent 4568 ed35dbe408ae
child 4570 ede247bbbf62
fix dumb name error causing error when non managers try to change his properties
hooks/syncsession.py
--- a/hooks/syncsession.py	Mon Feb 15 15:04:44 2010 +0100
+++ b/hooks/syncsession.py	Mon Feb 15 15:05:15 2010 +0100
@@ -153,7 +153,7 @@
             raise ValidationError(self.entity.eid,
                                   {'value': session._(str(ex))})
         if not session.user.matching_groups('managers'):
-            session.add_relation(entity.eid, 'for_user', session.user.eid)
+            session.add_relation(self.entity.eid, 'for_user', session.user.eid)
         else:
             _AddCWPropertyOp(session, cwprop=self.entity)
 
@@ -178,7 +178,7 @@
         if entity.for_user:
             for session_ in get_user_sessions(session.repo, entity.for_user[0].eid):
                 _ChangeCWPropertyOp(session, cwpropdict=session_.user.properties,
-                                  key=key, value=value)
+                                    key=key, value=value)
         else:
             # site wide properties
             _ChangeCWPropertyOp(session, cwpropdict=session.vreg['propertyvalues'],