server/hooks.py
branchstable
changeset 3887 130ac9aee402
parent 3886 6389e5d6edcb
child 3978 2c95e3033f64
equal deleted inserted replaced
3886:6389e5d6edcb 3887:130ac9aee402
   275 
   275 
   276     def precommit_event(self):
   276     def precommit_event(self):
   277         # recheck pending eids
   277         # recheck pending eids
   278         if self.eid in self.session.transaction_data.get('pendingeids', ()):
   278         if self.eid in self.session.transaction_data.get('pendingeids', ()):
   279             return
   279             return
   280         if self.rtype in self.session.transaction_data.get('pendingrtypes', ()):
   280         if self.rtype in self.session.transaction_data.get('pendingrtypes', ()):
   281             return
   281             return
   282         if self.session.unsafe_execute(*self._rql()).rowcount < 1:
   282         if self.session.unsafe_execute(*self._rql()).rowcount < 1:
   283             etype = self.session.describe(self.eid)[0]
   283             etype = self.session.describe(self.eid)[0]
   284             _ = self.session._
   284             _ = self.session._
   285             msg = _('at least one relation %(rtype)s is required on %(etype)s (%(eid)s)')
   285             msg = _('at least one relation %(rtype)s is required on %(etype)s (%(eid)s)')