From 2bfd613299a5eee95a3188ac2a52adf12d23bdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Thu, 4 Jul 2024 01:54:36 +0200 Subject: [PATCH] Only show active games --- core/templates/index.html | 4 ++++ core/views.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/templates/index.html b/core/templates/index.html index 04a9681..fdf3fae 100644 --- a/core/templates/index.html +++ b/core/templates/index.html @@ -22,6 +22,10 @@ {% for campaign in game.campaigns %}
+

+ {{ campaign.name }} +

Ends in: {{ campaign.end_at|timeuntil }}

+

{% for drop in campaign.drops %}
HttpResponse: for game in Game.objects.all().only("id", "image_url", "display_name", "slug"): campaigns: list[CampaignContext] = [] - for campaign in DropCampaign.objects.filter(game=game, status="ACTIVE").only( + for campaign in DropCampaign.objects.filter( + game=game, + status="ACTIVE", + end_at__gt=datetime.datetime.now(tz=datetime.UTC), + ).only( "id", "name", "image_url",