sobjects/supervising.py
branchstable
changeset 2101 08003e0354a7
parent 1977 606923dff11b
child 2102 268659907769
equal deleted inserted replaced
2100:89b825cdec74 2101:08003e0354a7
    34             updated = set(args[0].iterkeys())
    34             updated = set(args[0].iterkeys())
    35             if not (updated - frozenset(('eid', 'modification_date', 'last_login_time'))):
    35             if not (updated - frozenset(('eid', 'modification_date', 'last_login_time'))):
    36                 # don't record last_login_time update which are done
    36                 # don't record last_login_time update which are done
    37                 # automatically at login time
    37                 # automatically at login time
    38                 return False
    38                 return False
    39         self.session.add_query_data('pendingchanges', (self._event(), args))
    39         self.session.transaction_data.setdefault('pendingchanges', []).append(
       
    40             (self._event(), args))
    40         return True
    41         return True
    41 
    42 
    42     def _event(self):
    43     def _event(self):
    43         return self.event.split('_', 1)[1]
    44         return self.event.split('_', 1)[1]
    44 
    45 
    52             title = entity.dc_title()
    53             title = entity.dc_title()
    53         except:
    54         except:
    54             # may raise an error during deletion process, for instance due to
    55             # may raise an error during deletion process, for instance due to
    55             # missing required relation
    56             # missing required relation
    56             title = '#%s' % eid
    57             title = '#%s' % eid
    57         self.session.add_query_data('pendingchanges',
    58         self.session.transaction_data.setdefault('pendingchanges', []).append(
    58                                     ('delete_entity',
    59             ('delete_entity', (eid, str(entity.e_schema), title)))
    59                                      (eid, str(entity.e_schema),
       
    60                                       title)))
       
    61         return True
    60         return True
    62 
    61 
    63 
    62 
    64 def filter_changes(changes):
    63 def filter_changes(changes):
    65     """
    64     """