Skip to content

Commit

Permalink
Fix error when query parameters not passed (#239)
Browse files Browse the repository at this point in the history
if no parameters are passed to `/api/book` then just return
orders of ALL currency of ANY type.

Currently, if no query parameters are passed, then the API returns
500 status code
  • Loading branch information
redphix authored Sep 11, 2022
1 parent cb6475a commit 215e04f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@ class BookView(ListAPIView):
queryset = Order.objects.filter(status=Order.Status.PUB)

def get(self, request, format=None):
currency = request.GET.get("currency")
type = request.GET.get("type")
currency = request.GET.get("currency", 0)
type = request.GET.get("type", 2)

queryset = Order.objects.filter(status=Order.Status.PUB)

Expand Down

0 comments on commit 215e04f

Please sign in to comment.