Fix session being wrongly considered in progress
continuous-integration/drone/push Build is passing Details

Fixes #58
This commit is contained in:
Lukáš Kucharczyk 2023-10-04 18:12:13 +02:00
parent d2a9630b04
commit 3db1724e22
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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