server/repository.py
changeset 5811 e77cea9721e7
parent 5765 14daeb31ee67
parent 5808 2de32c0c293b
child 5815 282194aa43f3
equal deleted inserted replaced
5797:7183f32fad13 5811:e77cea9721e7
  1093         eschema = entity.e_schema
  1093         eschema = entity.e_schema
  1094         session.set_entity_cache(entity)
  1094         session.set_entity_cache(entity)
  1095         orig_edited_attributes = getattr(entity, 'edited_attributes', None)
  1095         orig_edited_attributes = getattr(entity, 'edited_attributes', None)
  1096         entity.edited_attributes = edited_attributes
  1096         entity.edited_attributes = edited_attributes
  1097         try:
  1097         try:
  1098             if session.is_hook_category_activated('integrity'):
       
  1099                 entity._cw_check()
       
  1100             only_inline_rels, need_fti_update = True, False
  1098             only_inline_rels, need_fti_update = True, False
  1101             relations = []
  1099             relations = []
  1102             source = self.source_from_eid(entity.eid, session)
  1100             source = self.source_from_eid(entity.eid, session)
  1103             for attr in list(edited_attributes):
  1101             for attr in list(edited_attributes):
  1104                 if attr == 'eid':
  1102                 if attr == 'eid':
  1125                 for attr, value, _ in relations:
  1123                 for attr, value, _ in relations:
  1126                     hm.call_hooks('before_add_relation', session,
  1124                     hm.call_hooks('before_add_relation', session,
  1127                                   eidfrom=entity.eid, rtype=attr, eidto=value)
  1125                                   eidfrom=entity.eid, rtype=attr, eidto=value)
  1128                 if not only_inline_rels:
  1126                 if not only_inline_rels:
  1129                     hm.call_hooks('before_update_entity', session, entity=entity)
  1127                     hm.call_hooks('before_update_entity', session, entity=entity)
       
  1128             if session.is_hook_category_activated('integrity'):
       
  1129                 entity._cw_check()
  1130             source.update_entity(session, entity)
  1130             source.update_entity(session, entity)
  1131             self.system_source.update_info(session, entity, need_fti_update)
  1131             self.system_source.update_info(session, entity, need_fti_update)
  1132             if source.should_call_hooks:
  1132             if source.should_call_hooks:
  1133                 if not only_inline_rels:
  1133                 if not only_inline_rels:
  1134                     hm.call_hooks('after_update_entity', session, entity=entity)
  1134                     hm.call_hooks('after_update_entity', session, entity=entity)