Skip to content

Commit

Permalink
fix(api): publishers returned for WorkDetailViewSet
Browse files Browse the repository at this point in the history
Slice publishers array for WorkDetailViewSet for
consisency with WorkPreviewViewSet to not return
anything beyond the first item. Prevents error
making the endpoint unavailable when more than
one publisher is (incorrectly) set.
  • Loading branch information
koeaw committed Sep 23, 2024
1 parent 8576887 commit 4186744
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis_ontology/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_queryset(self):
triple_set_from_obj__subj_id=OuterRef("pk"),
triple_set_from_obj__prop__name_reverse__in=["realises"],
).annotate(
publisher=Subquery(expression_publisher),
publisher=Subquery(expression_publisher[:1]),
places=ArraySubquery(expression_places),
)
).values(
Expand Down

0 comments on commit 4186744

Please sign in to comment.