Only show active games

This commit is contained in:
2024-07-04 01:54:36 +02:00
parent cea4d3d913
commit 2bfd613299
2 changed files with 9 additions and 1 deletions

View File

@ -87,7 +87,11 @@ def index(request: HttpRequest) -> 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",