idk
This commit is contained in:
@@ -45,7 +45,7 @@ class BoxService:
|
||||
|
||||
def add_products_to_open_box(self, open_box: OpenBox, product_data: Dict[Product, int]) -> None:
|
||||
"""Add products to an open box."""
|
||||
for product, quantity in product_data.items():
|
||||
for product, quantity in product_data.items(): # TODO BATCH THIS
|
||||
open_box_card = OpenBoxCard(
|
||||
id=str(uuid4()),
|
||||
open_box_id=open_box.id,
|
||||
@@ -94,7 +94,6 @@ class BoxService:
|
||||
num_cards_expected=create_box_data.num_cards_expected
|
||||
)
|
||||
self.db.add(product)
|
||||
self.db.flush()
|
||||
self.db.add(box)
|
||||
|
||||
return box, True
|
||||
@@ -150,7 +149,6 @@ class BoxService:
|
||||
date_opened=datetime.strptime(box_data.date_opened, "%Y-%m-%d") if box_data.date_opened else datetime.now()
|
||||
)
|
||||
self.db.add(open_box)
|
||||
self.db.flush()
|
||||
|
||||
staged_product_data = self.get_staged_product_data(box_data.file_ids)
|
||||
product_data = self.aggregate_staged_product_data(staged_product_data)
|
||||
|
Reference in New Issue
Block a user