Compare commits
2 Commits
b77089f7ad
...
97467c7a52
Author | SHA1 | Date |
---|---|---|
Lukáš Kucharczyk | 97467c7a52 | |
Lukáš Kucharczyk | 7842d6f45d |
|
@ -6,7 +6,7 @@ RUN npm install && \
|
|||
|
||||
FROM python:3.10.9-alpine
|
||||
|
||||
ENV VERSION_NUMBER 0.1.2-7-g24f4459
|
||||
ENV VERSION_NUMBER 0.1.2-9-g7842d6f
|
||||
ENV PROD 1
|
||||
|
||||
RUN apk add \
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# 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 %}
|
||||
{% if purchase %}
|
||||
<div class="text-center text-xl mb-4 dark:text-slate-400">
|
||||
<h1>Listing sessions only for purchaseee "{{ purchase }}" (total playtime: {{ total_duration }})</h1>
|
||||
<h1>Listing sessions only for purchase "{{ purchase }}" (total playtime: {{ total_duration }})</h1>
|
||||
<a class="dark:text-white hover:underline" href="{% url 'list_sessions' %}">View all sessions</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue