Skip to content

Commit

Permalink
Add order is allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
didrikmunther committed Aug 4, 2024
1 parent 0ee6fb1 commit 284d5f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dashboard/api/registration/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ def order_is_allowed(fair, company):

package = orders.filter(product__category__name="Package").first()
if package is None:
print("No package")
return False

for order in orders:
parent_products = order.product.specificproduct_set.all()

if parent_products.count() > 0 and not package in parent_products:
print(order.product, parent_products, "Parent not in package")
return False

return True


Expand Down

0 comments on commit 284d5f1

Please sign in to comment.