sobjects/email.py
branchtls-sprint
changeset 1138 22f634977c95
parent 0 b97547f5f1fa
child 1802 d628defebc17
equal deleted inserted replaced
1135:00eb43688a57 1138:22f634977c95
    12 class SetUseEmailRelationOp(PreCommitOperation):
    12 class SetUseEmailRelationOp(PreCommitOperation):
    13     """delay this operation to commit to avoid conflict with a late rql query
    13     """delay this operation to commit to avoid conflict with a late rql query
    14     already setting the relation
    14     already setting the relation
    15     """
    15     """
    16     rtype = 'use_email'
    16     rtype = 'use_email'
    17 
    17     fromeid = toeid = None # make pylint happy
       
    18     
    18     def condition(self):
    19     def condition(self):
    19         """check entity has use_email set for the email address"""
    20         """check entity has use_email set for the email address"""
    20         return not self.session.unsafe_execute(
    21         return not self.session.unsafe_execute(
    21             'Any X WHERE X eid %(x)s, X use_email Y, Y eid %(y)s',
    22             'Any X WHERE X eid %(x)s, X use_email Y, Y eid %(y)s',
    22             {'x': self.fromeid, 'y': self.toeid}, 'x')
    23             {'x': self.fromeid, 'y': self.toeid}, 'x')