Commit 27cb9835 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[repo] misc cleanup

branch : stable
parent 9d641d98cc86
......@@ -1039,9 +1039,9 @@ class Repository(object):
# call hooks for inlined relations
for attr, value in relations:'before_add_relation', attr, session,
entity.eid, attr, value)
entity.eid, attr, value)'after_add_relation', attr, session,
entity.eid, attr, value)
entity.eid, attr, value)
return entity.eid
def glob_update_entity(self, session, entity, edited_attributes):
......@@ -1058,7 +1058,7 @@ class Repository(object):
only_inline_rels, need_fti_update = True, False
relations = []
for attr in entity.keys():
for attr in edited_attributes:
if attr == 'eid':
rschema = eschema.subject_relation(attr)
......@@ -1068,8 +1068,8 @@ class Repository(object):
only_inline_rels = False
# inlined relation
previous_value = entity.related(attr)
if previous_value:
previous_value = entity.related(attr) or None
if previous_value is not None:
previous_value = previous_value[0][0] # got a result set
if previous_value == entity[attr]:
previous_value = None
......@@ -1100,7 +1100,7 @@ class Repository(object):
for attr, value, prevvalue in relations:
# if the relation is already cached, update existant cache
relcache = entity.relation_cached(attr, 'subject')
if prevvalue:
if prevvalue is not None:'after_delete_relation', attr, session,
entity.eid, attr, prevvalue)
if relcache is not None:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment