fix: strip timezone from datetime fields in task update endpoint
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 1m43s
Run Tests / Backend Tests (push) Failing after 42s
Run Tests / Frontend Tests (push) Has started running
Run Tests / Test Summary (push) Has been cancelled

This commit is contained in:
Gan, Jimmy
2026-04-02 01:28:18 +08:00
parent 5d7d774ca1
commit f2b490e2e8
+6
View File
@@ -158,6 +158,12 @@ async def update_task(
if new_status == "done" and old_status != "done":
updates["completed_at"] = datetime.utcnow()
# Strip timezone info from datetime fields (database uses TIMESTAMP not TIMESTAMPTZ)
if "due_date" in updates and updates["due_date"] is not None:
updates["due_date"] = updates["due_date"].replace(tzinfo=None)
if "completed_at" in updates and updates["completed_at"] is not None:
updates["completed_at"] = updates["completed_at"].replace(tzinfo=None)
updated_task = await opc_db.update_task(
task_id=task_id,
updates=updates,