Only show active games
This commit is contained in:
@ -22,6 +22,10 @@
|
||||
</div>
|
||||
{% for campaign in game.campaigns %}
|
||||
<div class="card-body card-bottom">
|
||||
<h3 class="h6">
|
||||
{{ campaign.name }}
|
||||
<p>Ends in: {{ campaign.end_at|timeuntil }}</p>
|
||||
</h3>
|
||||
{% for drop in campaign.drops %}
|
||||
<div class="col-6 col-md-4 d-flex align-items-center mb-2 position-relative">
|
||||
<img src="{{ drop.image_url }}"
|
||||
|
@ -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",
|
||||
|
Reference in New Issue
Block a user