Fix timestamp method and loop variable order issues

Updated `datetime.utcnow()` to `datetime.now()` to align with local timezone handling. Corrected the order of unpacked variables in the loop to match the structure of `pucks_with_latest_events`.
This commit is contained in:
GotthardG 2025-01-31 12:58:15 +01:00
parent 3757950b51
commit 7ce8c50179

View File

@ -115,7 +115,7 @@ async def set_tell_positions(
puck_id=puck.id,
tell_position=None,
event_type="puck_removed", # Event type set to "puck_removed"
timestamp=datetime.utcnow(),
timestamp=datetime.now(),
)
db.add(remove_event)
@ -467,7 +467,7 @@ async def get_pucks_by_slot(slot_identifier: str, db: Session = Depends(get_db))
# Prepare the final response
results = []
for puck, event_type, dewar, tell_position in pucks_with_latest_events:
for puck, event_type, tell_position, dewar in pucks_with_latest_events:
logger.debug(
f"Puck ID: {puck.id}, Name: {puck.puck_name}, Event Type: {event_type}, "
f"Tell Position: {tell_position}"