Explorar el Código

fix sms batch creation

tripeur hace 2 años
padre
commit
a3460a7fa4
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/api/endpoints/project.py

+ 2 - 2
app/api/endpoints/project.py

@@ -1,4 +1,4 @@
-from datetime import timedelta, datetime
+from datetime import timedelta, datetime, timezone
 from uuid import UUID
 
 from fastapi import APIRouter, Depends, HTTPException
@@ -192,7 +192,7 @@ async def create_sms_batch(
     # Get all slots
     slots = session.execute(select(Slot).where(Slot.project_id == project_id))
     sms_list = []
-    now = datetime.now()
+    now = datetime.now(timezone.utc)
     for slot in slots.scalars():
         # Replace the slot placeholder by their value
         slot_content = (