Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Fix page_size setting for related media (#394)
Olga Bulatc67f7bd5545a
diff --git a/openverse_api/catalog/api/views/media_views.py b/openverse_api/catalog/api/views/media_views.pyindex 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 @@ class MediaViewSet(ReadOnlyModelViewSet):)self.paginator.result_count = num_resultsself.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 = 10except ValueError as e:raise get_api_exception(getattr(e, "message", str(e)))