Commit 5dd7e49d authored by Julien Muchembled's avatar Julien Muchembled

Allow call to 'SimulableMixin.updateSimulation' even after its before_commit hook was called

parent a1a842b4
...@@ -498,7 +498,8 @@ class SimulableMixin(Base): ...@@ -498,7 +498,8 @@ class SimulableMixin(Base):
kw, ignore = tv[key] kw, ignore = tv[key]
kw.update(item_list) kw.update(item_list)
except KeyError: except KeyError:
ignore = set() ignore_key = key + ('ignore',)
ignore = tv.pop(ignore_key, set())
tv[key] = kw, ignore tv[key] = kw, ignore
def before_commit(): def before_commit():
if kw: if kw:
...@@ -511,7 +512,9 @@ class SimulableMixin(Base): ...@@ -511,7 +512,9 @@ class SimulableMixin(Base):
after_tag='built:'+ path, # see SimulatedDeliveryBuilder after_tag='built:'+ path, # see SimulatedDeliveryBuilder
priority=3, priority=3,
)._updateSimulation(**kw) )._updateSimulation(**kw)
tv[key] = None # disallow further calls to 'updateSimulation' for self del tv[key]
ignore.update(kw)
tv[ignore_key] = ignore
transaction.get().addBeforeCommitHook(before_commit) transaction.get().addBeforeCommitHook(before_commit)
for k, v in item_list: for k, v in item_list:
if not v: if not v:
......
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