Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make synclist task with policy 'exclude' include all versions not just is_latest AAH-485 #783

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/585.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix synclist to exclude all versions of un-checked collection.
9 changes: 7 additions & 2 deletions galaxy_ng/app/tasks/synclist.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,21 @@ def curate_synclist_repository(synclist_pk, **kwargs):

namespaces = synclist.namespaces.filter().values_list("name", flat=True)

# include adds only highest version and exclude removes all versions of the collection.
is_highest_query_param = {}
rochacbruno marked this conversation as resolved.
Show resolved Hide resolved
if synclist.policy == 'include':
is_highest_query_param = {"is_highest": True}

collection_versions = CollectionVersion.objects.filter(
Q(
repositories=synclist.upstream_repository,
collection__namespace__in=namespaces,
is_highest=True,
**is_highest_query_param
)
| Q(
collection__in=synclist.collections.all(),
repositories=synclist.repository,
is_highest=True,
**is_highest_query_param
)
)

Expand Down