From c67f7bd5545aed4fa1fc47039ec4af0684b30cbe Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Sat, 11 Dec 2021 22:22:45 +0300 Subject: [PATCH] Fix page_size setting for related media (#394) Co-authored-by: Zack Krida Co-authored-by: Madison Swain-Bowden --- openverse_api/catalog/api/views/media_views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openverse_api/catalog/api/views/media_views.py b/openverse_api/catalog/api/views/media_views.py index e083ec8f8..63c33fdbd 100644 --- a/openverse_api/catalog/api/views/media_views.py +++ b/openverse_api/catalog/api/views/media_views.py @@ -105,7 +105,8 @@ def related(self, request, identifier=None, *_, **__): ) self.paginator.result_count = num_results self.paginator.page_count = 1 - self.paginator.page_size = num_results + # `page_size` refers to the maximum number of related images to return. + self.paginator.page_size = 10 except ValueError as e: raise get_api_exception(getattr(e, "message", str(e)))