From 3741a69cd297ce5f4a47cdf49c76b96dc68a66c3 Mon Sep 17 00:00:00 2001 From: jamiepine <32987599+jamiepine@users.noreply.github.com> Date: Sat, 3 Oct 2026 09:26:19 +0000 Subject: [PATCH] fix: convert the utcnow() calls added to CloudSettings since the PR was opened --- backend/database/models.py | 2 +- backend/services/cloud.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/database/models.py b/backend/database/models.py index 5ced0c15..511b4efd 100644 --- a/backend/database/models.py +++ b/backend/database/models.py @@ -253,7 +253,7 @@ class CloudSettings(Base): device_name = Column(String, nullable=True) account_user_id = Column(String, nullable=True) connected_at = Column(DateTime, nullable=True) - updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) + updated_at = Column(DateTime, default=lambda: datetime.now(UTC), onupdate=lambda: datetime.now(UTC)) class MCPClientBinding(Base): diff --git a/backend/services/cloud.py b/backend/services/cloud.py index 1485b4df..92a3df28 100644 --- a/backend/services/cloud.py +++ b/backend/services/cloud.py @@ -140,13 +140,13 @@ def _get_or_create_row(db: Session) -> DBCloudSettings: def _store_key(db: Session, *, api_key: str, device_name: str | None, account_user_id: str | None): - from datetime import datetime + from datetime import UTC, datetime row = _get_or_create_row(db) row.api_key = api_key row.device_name = device_name row.account_user_id = account_user_id - row.connected_at = datetime.utcnow() + row.connected_at = datetime.now(UTC) db.commit()