diff --git a/api/advent22_api/core/depends.py b/api/advent22_api/core/depends.py index 96a52ef..b95eea8 100644 --- a/api/advent22_api/core/depends.py +++ b/api/advent22_api/core/depends.py @@ -1,4 +1,5 @@ import re +from collections import defaultdict from dataclasses import dataclass from datetime import date from io import BytesIO @@ -71,9 +72,8 @@ async def get_all_parts( *rnd.sample(days, solution_length % num_days), ] - result: dict[int, str] = {} + result: defaultdict[int, str] = defaultdict(str) for day, letter in zip(solution_days, cfg.solution.clean): - result[day] = result.get(day, "") result[day] += letter result |= {missed_day: "" for missed_day in set(days) - set(result.keys())} diff --git a/api/advent22_api/core/helpers.py b/api/advent22_api/core/helpers.py index e33db43..78675d1 100644 --- a/api/advent22_api/core/helpers.py +++ b/api/advent22_api/core/helpers.py @@ -171,7 +171,7 @@ class EventDates: @property def next(self) -> date | None: """Datum des nächsten Ereignisses""" - return self.get_next(today=datetime.today().date()) + return self.get_next(today=date.today()) @property def last(self) -> date: