Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
fix get_today_homework()
Browse files Browse the repository at this point in the history
  • Loading branch information
ilugakov committed Sep 27, 2023
1 parent 893b898 commit daaec0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vulcan_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ async def get_today_homework(self) -> List[data.Homework]:
if not homework:
return []

homework_by_deadline = defaultdict(list, {hw.deadline.date: [hw] for hw in homework})
homework_by_deadline = defaultdict(list)
for hw in homework:
homework_by_deadline[hw.deadline.date].append(hw)

closest_deadline = min(homework_by_deadline.keys())
homework = homework_by_deadline[closest_deadline]
Expand Down

0 comments on commit daaec0b

Please sign in to comment.