Compare commits
No commits in common. "97467c7a52b6d1a8f9d029d8be15a9844d5122ee" and "b77089f7ad965dbdd159a3f8cb4cd771531838a3" have entirely different histories.
97467c7a52
...
b77089f7ad
|
@ -6,7 +6,7 @@ RUN npm install && \
|
||||||
|
|
||||||
FROM python:3.10.9-alpine
|
FROM python:3.10.9-alpine
|
||||||
|
|
||||||
ENV VERSION_NUMBER 0.1.2-9-g7842d6f
|
ENV VERSION_NUMBER 0.1.2-7-g24f4459
|
||||||
ENV PROD 1
|
ENV PROD 1
|
||||||
|
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
# Generated by Django 4.1.5 on 2023-01-09 18:04
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
from datetime import timedelta
|
|
||||||
|
|
||||||
|
|
||||||
def set_duration_manual_none_to_zero(apps, schema_editor):
|
|
||||||
Session = apps.get_model("tracker", "Session")
|
|
||||||
for session in Session.objects.all():
|
|
||||||
if session.duration_calculated == None:
|
|
||||||
session.duration_calculated = timedelta(0)
|
|
||||||
session.save()
|
|
||||||
|
|
||||||
|
|
||||||
def revert_set_duration_manual_none_to_zero(apps, schema_editor):
|
|
||||||
Session = apps.get_model("tracker", "Session")
|
|
||||||
for session in Session.objects.all():
|
|
||||||
if session.duration_calculated == timedelta(0):
|
|
||||||
session.duration_calculated = None
|
|
||||||
session.save()
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("tracker", "0005_auto_20230109_1843"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RunPython(
|
|
||||||
set_duration_manual_none_to_zero,
|
|
||||||
revert_set_duration_manual_none_to_zero,
|
|
||||||
)
|
|
||||||
]
|
|
|
@ -5,7 +5,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if purchase %}
|
{% if purchase %}
|
||||||
<div class="text-center text-xl mb-4 dark:text-slate-400">
|
<div class="text-center text-xl mb-4 dark:text-slate-400">
|
||||||
<h1>Listing sessions only for purchase "{{ purchase }}" (total playtime: {{ total_duration }})</h1>
|
<h1>Listing sessions only for purchaseee "{{ purchase }}" (total playtime: {{ total_duration }})</h1>
|
||||||
<a class="dark:text-white hover:underline" href="{% url 'list_sessions' %}">View all sessions</a>
|
<a class="dark:text-white hover:underline" href="{% url 'list_sessions' %}">View all sessions</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue