mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
fixed limit random recipe
This commit is contained in:
@@ -72,7 +72,7 @@ class StandardFilterMixin(ViewSetMixin):
|
||||
random = self.request.query_params.get('random', False)
|
||||
if limit is not None:
|
||||
if random:
|
||||
queryset = queryset.order_by("?")[:limit]
|
||||
queryset = queryset.order_by("?")[:int(limit)]
|
||||
else:
|
||||
queryset = queryset[:int(limit)]
|
||||
return queryset
|
||||
|
||||
Reference in New Issue
Block a user