1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-11-21 21:44:19 +00:00

fix sqlalchemy exception

This commit is contained in:
valentino-sm 2021-05-04 13:23:20 +05:00 committed by Stefano Pigozzi
parent ce8ab7ad85
commit 730fa96e56

View file

@ -173,8 +173,6 @@ class Worker(threading.Thread):
self.user = db.User(w=self)
# Add the new record to the db
self.session.add(self.user)
# Flush the session to get an userid
self.session.flush()
# If the will be owner flag is set
if will_be_owner:
# Become owner
@ -649,7 +647,6 @@ class Worker(threading.Thread):
notes=notes if not isinstance(notes, CancelSignal) else "")
# Add the record to the session and get an ID
self.session.add(order)
self.session.flush()
# For each product added to the cart, create a new OrderItem
for product in cart:
# Create {quantity} new OrderItems