From 470426004ebfcda5a7ca988a5be5c66eba5453d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 4 Oct 2023 18:12:13 +0200 Subject: [PATCH] Fix session being wrongly considered in progress Fixes #58 --- CHANGELOG.md | 1 + games/views.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba9a2ab..f00b65f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Change fonts to IBM Plex * Only use local WOFF2 font files * Add game overview page (https://git.kucharczyk.xyz/lukas/timetracker/issues/8) +* Fix session being wrongly considered in progress if it had a certain amount of manual hours (https://git.kucharczyk.xyz/lukas/timetracker/issues/58) ## 1.0.3 / 2023-02-20 17:16+01:00 diff --git a/games/views.py b/games/views.py index 4c111ac..f422b3b 100644 --- a/games/views.py +++ b/games/views.py @@ -192,7 +192,9 @@ def list_sessions( dataset = Session.objects.all().order_by("-timestamp_start") for session in dataset: - if session.timestamp_end == None and session.duration_manual.seconds == 0: + if session.timestamp_end == None and session.duration_manual == timedelta( + seconds=0 + ): session.timestamp_end = datetime.now(ZoneInfo(settings.TIME_ZONE)) session.unfinished = True