Skip to content

Commit

Permalink
Fixing version export with version creation
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jul 21, 2022
1 parent c01eaa4 commit 847cf11
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,11 @@ def persist_new_version(cls, obj, user=None, **kwargs):
obj.update_version_data(head)
obj.save(**kwargs)

if get(settings, 'TEST_MODE', False) or sync:
seed_children_to_new_version(obj.resource_type.lower(), obj.id, False, sync)
is_test_mode = get(settings, 'TEST_MODE', False)
if is_test_mode or sync:
seed_children_to_new_version(obj.resource_type.lower(), obj.id, not is_test_mode, sync)
else:
seed_children_to_new_version.delay(obj.resource_type.lower(), obj.id, sync)
seed_children_to_new_version.delay(obj.resource_type.lower(), obj.id, True, sync)

if obj.id:
obj.sibling_versions.update(is_latest_version=False)
Expand Down

0 comments on commit 847cf11

Please sign in to comment.