diff --git a/pulp_ansible/app/tasks/collections.py b/pulp_ansible/app/tasks/collections.py index 4890615d7..cb73bade6 100644 --- a/pulp_ansible/app/tasks/collections.py +++ b/pulp_ansible/app/tasks/collections.py @@ -443,7 +443,8 @@ def is_new_highest(new, old): # we only have one version, so mark it as the highest if collection_version.collection.versions.count() == 1: collection_version.is_highest = True - collection_version.save() + if save: + collection_version.save() return # compute highest from the whole list ... @@ -454,7 +455,8 @@ def is_new_highest(new, old): highest = (sv, cv) highest[1].is_highest = True - highest[1].save() + if save: + highest[1].save() return # exit if the new CV is not higher