Skip to content

Commit

Permalink
add last_sync_task on retrieve
Browse files Browse the repository at this point in the history
fixes: pulp#1506
  • Loading branch information
jerabekjiri committed Aug 29, 2023
1 parent 958293a commit 6bea175
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pulp_ansible/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ class AnsibleRepositoryViewSet(RepositoryViewSet, ModifyRepositoryActionMixin, R

def get_queryset(self):
qs = super().get_queryset()
if getattr(self, "action", "") == "list":
action = getattr(self, "action", "")
if action == "list" or action == "retrieve":
qs = get_queryset_annotated_with_last_sync_task(qs)

return qs
Expand Down Expand Up @@ -997,7 +998,8 @@ class CollectionRemoteViewSet(RemoteViewSet, RolesMixin):

def get_queryset(self):
qs = super().get_queryset()
if getattr(self, "action", "") == "list":
action = getattr(self, "action", "")
if action == "list" or action == "retrieve":
qs = get_queryset_annotated_with_last_sync_task(qs)

return qs
Expand Down

0 comments on commit 6bea175

Please sign in to comment.