Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit f8d87e9

Browse files
committed
Fix: make timestamps comparable
1 parent d7a70ba commit f8d87e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bookserver/crud.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,15 @@ async def fetch_last_answer_table_entry(
263263
) -> schemas.LogItemIncoming:
264264
rcd = runestone_component_dict[EVENT2TABLE[query_data.event]]
265265
tbl = rcd.model
266+
deadline_offset_naive = query_data.deadline.replace(tzinfo=None)
266267
query = (
267268
select(tbl)
268269
.where(
269270
and_(
270271
tbl.div_id == query_data.div_id,
271272
tbl.course_name == query_data.course,
272273
tbl.sid == query_data.sid,
273-
tbl.timestamp <= query_data.deadline,
274+
tbl.timestamp <= deadline_offset_naive,
274275
)
275276
)
276277
.order_by(tbl.timestamp.desc())

0 commit comments

Comments
 (0)