From 4186744a6571f47b8c4131aed5cd3f45bd6daac8 Mon Sep 17 00:00:00 2001 From: KK Date: Mon, 23 Sep 2024 12:05:39 +0200 Subject: [PATCH] fix(api): publishers returned for WorkDetailViewSet 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. --- apis_ontology/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis_ontology/api/views.py b/apis_ontology/api/views.py index 0ad558f..27e0953 100644 --- a/apis_ontology/api/views.py +++ b/apis_ontology/api/views.py @@ -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(