a
This commit is contained in:
@@ -171,9 +171,7 @@ class AllProductsView(APIView):
|
|||||||
# Price filters
|
# Price filters
|
||||||
price_gte = request.query_params.get('price_gte', None)
|
price_gte = request.query_params.get('price_gte', None)
|
||||||
price_lte = request.query_params.get('price_lte', None)
|
price_lte = request.query_params.get('price_lte', None)
|
||||||
|
|
||||||
if type(price_gte) != int or type(price_lte) != int:
|
|
||||||
return Response({'detail': 'value error price_gte and price_lte should be a number'}, status=status.HTTP_400_BAD_REQUEST)
|
|
||||||
if price_gte:
|
if price_gte:
|
||||||
products = products.filter(price__gte=price_gte)
|
products = products.filter(price__gte=price_gte)
|
||||||
if price_lte:
|
if price_lte:
|
||||||
|
|||||||
Reference in New Issue
Block a user