From 86f8fde8fa87ca8d6d9c02abc560534d00be7892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Tue, 9 Jul 2024 07:32:49 +0200 Subject: [PATCH] Avoid errors when displaying game overview with zero sessions --- CHANGELOG.md | 1 + games/templates/view_game.html | 2 ++ games/views.py | 25 +++++++++++++++---------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e81e0b..f4596a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ## Fixed * Fix title not being displayed on the Recent sessions page +* Avoid errors when displaying game overview with zero sessions ## 1.5.2 / 2024-01-14 21:27+01:00 diff --git a/games/templates/view_game.html b/games/templates/view_game.html index 422770f..00fa2e5 100644 --- a/games/templates/view_game.html +++ b/games/templates/view_game.html @@ -62,6 +62,7 @@

Sessions ({{ session_count }}) +{% if latest_session_id %} {% url 'view_game_start_session_from_session' latest_session_id as add_session_link %} New +{% endif %} and Notes ({{ sessions_with_notes_count }})