Skip to content

Commit

Permalink
Fix is_highest logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed Jan 7, 2021
1 parent e14a863 commit 97e7054
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/8039.bugfix
@@ -0,0 +1 @@
Fix collection version comparison on re-syncs
7 changes: 6 additions & 1 deletion pulp_ansible/app/tasks/collections.py
Expand Up @@ -246,6 +246,10 @@ def _update_highest_version(collection_version):
last_highest.save()
collection_version.save()

elif collection_version.is_highest and collection_version.version != last_highest.version:
collection_version.is_highest = False
collection_version.save()


class AnsibleDeclarativeVersion(DeclarativeVersion):
"""
Expand Down Expand Up @@ -600,7 +604,8 @@ async def _post_save(self, batch):
continue
collection_version = d_content.content
docs_blob = d_content.extra_data.get("docs_blob", {})
collection_version.docs_blob = docs_blob
if docs_blob:
collection_version.docs_blob = docs_blob

for d_artifact in d_content.d_artifacts:
artifact = d_artifact.artifact
Expand Down

0 comments on commit 97e7054

Please sign in to comment.