Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix settings seconds in migrations (#9885)

Marcin Gębalae16d731ddd92
diff --git a/saleor/discount/migrations/0041_fulfill_orderdiscount_token_created_at_old_id.py b/saleor/discount/migrations/0041_fulfill_orderdiscount_token_created_at_old_id.py
index ed56a00b02..fd7e384dbc 100644
--- a/saleor/discount/migrations/0041_fulfill_orderdiscount_token_created_at_old_id.py
+++ b/saleor/discount/migrations/0041_fulfill_orderdiscount_token_created_at_old_id.py
@@ -22,9 +22,7 @@ def set_order_discount_token_and_created_at(apps, _schema_editor):
for discount in discounts:
order = order_in_bulk.get(discount.order_id)
discount.created_at = (
- order.created_at.replace(second=discount.pk)
- if order
- else datetime.datetime.now(pytz.UTC)
+ order.created_at if order else datetime.datetime.now(pytz.UTC)
)
discount.token = uuid.uuid4()