diff --git a/CHANGELOG.md b/CHANGELOG.md index a6818fc..62dbb94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## Unreleased + +* Fixed + * When filtering by game, the "Filtering by (...)" text would erroneously list an unrelated platform + ## 0.2.3 / 2023-01-15 23:13+01:00 * Allow filtering by platform and game on session list (https://git.kucharczyk.xyz/lukas/timetracker/issues/32) diff --git a/src/web/tracker/templates/list_sessions.html b/src/web/tracker/templates/list_sessions.html index a5ca87c..9c225ec 100644 --- a/src/web/tracker/templates/list_sessions.html +++ b/src/web/tracker/templates/list_sessions.html @@ -10,11 +10,11 @@ {% if dataset.count >= 1 %}
Total playtime: {{ total_duration }} over {{ dataset.count }} sessions.
{% endif %} - {% if purchase or platform %} + {% if purchase or platform or game %} - Filtering by "{% firstof purchase platform %}" + Filtering by "{% firstof purchase platform game %}" {% if purchase %}See all platforms{% endif %} {% endif %} {% if dataset.count >= 1 %} diff --git a/src/web/tracker/views.py b/src/web/tracker/views.py index 0675dc9..ddf85f1 100644 --- a/src/web/tracker/views.py +++ b/src/web/tracker/views.py @@ -63,7 +63,7 @@ def list_sessions(request, filter="", purchase_id="", platform_id="", game_id="" context["platform"] = Platform.objects.get(id=platform_id) elif filter == "game": dataset = Session.objects.filter(purchase__game=game_id) - context["game"] = Platform.objects.get(id=game_id) + context["game"] = Game.objects.get(id=game_id) else: dataset = Session.objects.all().order_by("-timestamp_start")