From 75b16a98d34ffbf86742d96f07f04ca1d7e72340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isak=20Ohlsson=20=C3=85ngnell?= <40887124+islean@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:24:43 +0200 Subject: [PATCH] Make sure ordered_at is evaluated at persist (#3629) (patch) ### Fixed - Ordered_at is updated for each submitted order --- cg/store/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cg/store/models.py b/cg/store/models.py index 36d9413126..60a33460f2 100644 --- a/cg/store/models.py +++ b/cg/store/models.py @@ -967,7 +967,7 @@ class Order(Base): cases: Mapped[list[Case]] = orm.relationship(secondary=order_case, back_populates="orders") customer_id: Mapped[int] = mapped_column(ForeignKey("customer.id")) customer: Mapped[Customer] = orm.relationship(foreign_keys=[customer_id]) - order_date: Mapped[datetime] = mapped_column(default=datetime.now()) + order_date: Mapped[datetime] = mapped_column(default=datetime.now) ticket_id: Mapped[int] = mapped_column(unique=True, index=True) workflow: Mapped[str] = mapped_column(types.Enum(*(workflow.value for workflow in Workflow))) is_delivered: Mapped[bool] = mapped_column(default=False)