[hooks] fix dummy AttributeError in SetUseEmailRelationOp
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 23 Sep 2009 12:30:56 +0200
changeset 3421 7fec79c1c11f
parent 3420 15f17399bda2
child 3422 089c4b71ac16
[hooks] fix dummy AttributeError in SetUseEmailRelationOp
hooks/email.py
--- a/hooks/email.py	Wed Sep 23 12:29:53 2009 +0200
+++ b/hooks/email.py	Wed Sep 23 12:30:56 2009 +0200
@@ -27,9 +27,9 @@
             # we've to handle cardinaly by ourselves since we're using unsafe_execute
             # but use session.execute and not session.unsafe_execute to check we
             # can change the relation
-            ensure_card_respected(session.execute, session,
-                                  self.fromeid, self.rtype, self.toeid)
-            session.unsafe_execute(
+            ensure_card_respected(self.session.execute, self.session,
+                                  self.entity.eid, self.rtype, self.email.eid)
+            self.session.unsafe_execute(
                 'SET X %s Y WHERE X eid %%(x)s, Y eid %%(y)s' % self.rtype,
                 {'x': self.entity.eid, 'y': self.email.eid}, 'x')