diff --git a/personal_data/fetchers/wanikani_lessons.py b/personal_data/fetchers/wanikani_lessons.py index 575ac36..99cbd20 100644 --- a/personal_data/fetchers/wanikani_lessons.py +++ b/personal_data/fetchers/wanikani_lessons.py @@ -1,8 +1,8 @@ import dataclasses import datetime -from email.utils import parsedate_to_datetime import logging from collections.abc import Iterator, Mapping +from email.utils import parsedate_to_datetime import requests_util @@ -89,9 +89,13 @@ class WaniKaniSummaryFetcher(Scraper): total_lessons = sum(len(lesson.get('subject_ids', [])) for lesson in lessons) reviews = data.get('data', {}).get('reviews', []) - date_hdr = response.headers.get("Date") + date_hdr = response.headers.get('Date') try: - now = parsedate_to_datetime(date_hdr) if date_hdr else datetime.datetime.now(datetime.timezone.utc) + now = ( + parsedate_to_datetime(date_hdr) + if date_hdr + else datetime.datetime.now(datetime.timezone.utc) + ) except Exception: now = datetime.datetime.now(datetime.timezone.utc) total_reviews = 0