Display finished DLCs in stats better
This commit is contained in:
parent
7dc43fbf77
commit
d78139a5b3
|
@ -136,7 +136,13 @@
|
|||
<tr>
|
||||
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">
|
||||
<a class="underline decoration-slate-500 sm:decoration-2"
|
||||
href="{% url 'edit_purchase' purchase.id %}">{{ purchase.edition.name }}</a>
|
||||
href="{% url 'edit_purchase' purchase.id %}">
|
||||
{% if purchase.type == 'dlc' %}
|
||||
{{ purchase.name }} ({{ purchase.edition.name }} DLC)
|
||||
{% else %}
|
||||
{{ purchase.edition.name }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ purchase.date_finished | date:"d/m/Y" }}</td>
|
||||
</tr>
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
{% url 'start_game_session' game.id as add_session_link %}
|
||||
{% include 'components/button.html' with title="Start new session" text="New" link=add_session_link %}
|
||||
and Notes <span class="dark:text-slate-500">({{ sessions_with_notes_count }})</span>
|
||||
|
||||
</h1>
|
||||
<ul>
|
||||
{% for session in sessions %}
|
||||
|
|
|
@ -2,7 +2,7 @@ from datetime import datetime, timedelta
|
|||
from typing import Any, Callable
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db.models import Count, F, Prefetch, Sum
|
||||
from django.db.models import Count, F, Prefetch, Q, Sum
|
||||
from django.db.models.functions import TruncDate
|
||||
from django.http import (
|
||||
HttpRequest,
|
||||
|
@ -344,8 +344,8 @@ def stats(request, year: int = 0):
|
|||
this_year_purchases_unfinished = this_year_purchases_without_refunded.filter(
|
||||
date_finished__isnull=True
|
||||
).filter(
|
||||
type=Purchase.GAME
|
||||
) # do not count DLC etc.
|
||||
Q(type=Purchase.GAME) | Q(type=Purchase.DLC)
|
||||
) # do not count battle passes etc.
|
||||
|
||||
this_year_purchases_unfinished_percent = int(
|
||||
safe_division(
|
||||
|
|
Loading…
Reference in New Issue