fixed limit random recipe
This commit is contained in:
parent
e7f8d58a7d
commit
b552badff7
@ -72,7 +72,7 @@ class StandardFilterMixin(ViewSetMixin):
|
|||||||
random = self.request.query_params.get('random', False)
|
random = self.request.query_params.get('random', False)
|
||||||
if limit is not None:
|
if limit is not None:
|
||||||
if random:
|
if random:
|
||||||
queryset = queryset.order_by("?")[:limit]
|
queryset = queryset.order_by("?")[:int(limit)]
|
||||||
else:
|
else:
|
||||||
queryset = queryset[:int(limit)]
|
queryset = queryset[:int(limit)]
|
||||||
return queryset
|
return queryset
|
||||||
|
Loading…
Reference in New Issue
Block a user