From c86a522b5ea3e7e9d3b028763eac0b40a3653627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20L=C3=B3pez=20Ferrando?= Date: Wed, 1 Jan 2025 12:26:39 +0100 Subject: [PATCH] join ifs --- src/fsrs/scheduler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fsrs/scheduler.py b/src/fsrs/scheduler.py index 5562852..e32d47e 100644 --- a/src/fsrs/scheduler.py +++ b/src/fsrs/scheduler.py @@ -113,15 +113,14 @@ def review_card( tuple[Card, ReviewLog]: A tuple containing the updated, reviewed card and its corresponding review log. """ - if review_datetime is not None: + if review_datetime is None: + review_datetime = datetime.now(timezone.utc) + else: if review_datetime.tzinfo is None: review_datetime = review_datetime.replace(tzinfo=timezone.utc) elif review_datetime.tzinfo != timezone.utc: review_datetime = review_datetime.astimezone(timezone.utc) - if review_datetime is None: - review_datetime = datetime.now(timezone.utc) - card = deepcopy(card) review_log = ReviewLog(