mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-24 06:44:19 +00:00
fix-2 sqlalchemy exception
This commit is contained in:
parent
d0b7da2ab2
commit
6a70a45211
2 changed files with 2 additions and 1 deletions
|
@ -297,6 +297,7 @@ class OrderItem(DeferredReflection, TableDeclarativeBase):
|
|||
product = relationship("Product")
|
||||
# The order in which this item is being purchased
|
||||
order_id = Column(Integer, ForeignKey("orders.order_id"), nullable=False)
|
||||
order = relationship("Order")
|
||||
|
||||
# Extra table parameters
|
||||
__tablename__ = "orderitems"
|
||||
|
|
|
@ -652,7 +652,7 @@ class Worker(threading.Thread):
|
|||
# Create {quantity} new OrderItems
|
||||
for i in range(0, cart[product][1]):
|
||||
order_item = db.OrderItem(product=cart[product][0],
|
||||
order_id=order.order_id)
|
||||
order=order)
|
||||
self.session.add(order_item)
|
||||
# Ensure the user has enough credit to make the purchase
|
||||
credit_required = self.__get_cart_value(cart) - self.user.credit
|
||||
|
|
Loading…
Reference in a new issue