Skip to content

Commit

Permalink
Fix looking up price level options in order view
Browse files Browse the repository at this point in the history
  • Loading branch information
staticfox committed Feb 20, 2025
1 parent ab3b661 commit 9cbbadb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions registration/views/ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,11 @@ def checkout(request):

for cart in (cart_items or []):
postData = json.loads(cart.formData)
priceLevelId = int(postData["priceLevel"]["id"])
priceLevel = PriceLevel.objects.get(id=priceLevelId)
priceLevel = postData["priceLevel"]

for postDataOption in priceLevel["options"]:
option = PriceLevelOption.objects.get(id=int(postDataOption["id"]))

for option in priceLevel.priceLevelOptions.all():
if option.quantity is None:
continue

Expand All @@ -295,8 +296,6 @@ def checkout(request):
"apisError": f"{option.optionName} is sold out. Please remove it from your cart."
})

return common.abort(400, {"apisError": "passed!"})

if subtotal == 0:
status, message, order = doZeroCheckout(discount, cart_items, order_items)
if not status:
Expand Down

0 comments on commit 9cbbadb

Please sign in to comment.