lingo: error out if there's no amount parameter passed to basket API (#10160)
This commit is contained in:
parent
a2299d423a
commit
a2b8fab5b1
|
@ -92,6 +92,10 @@ class AddBasketItemApiView(View):
|
|||
request_body = json.loads(self.request.body)
|
||||
extra = request_body.get('extra', {})
|
||||
|
||||
if not 'amount' in request.GET and not 'amount' in request_body and \
|
||||
not 'amount' in extra:
|
||||
raise Exception('missing amount parameter')
|
||||
|
||||
item = BasketItem(amount=0)
|
||||
item.amount = self.get_amount(request.GET.getlist('amount'))
|
||||
|
||||
|
|
Loading…
Reference in New Issue