Order by timestamp_start by default

This commit is contained in:
Lukáš Kucharczyk 2023-01-05 23:30:13 +01:00
parent fd9bf8c026
commit 15ed6504b1
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
3 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
## Unreleased
* Order by timestamp_start by default
* Add pre-commit hook to update version
* Improve the newcomer experience by guiding through each step
* Fix errors with empty database

View File

@ -6,7 +6,7 @@ RUN npm install && \
FROM python:3.10-slim-bullseye
ENV VERSION_NUMBER 0.1.0-45-g5172c38
ENV VERSION_NUMBER 0.1.0-46-gfd9bf8c
ENV PROD 1
RUN useradd --create-home --uid 1000 timetracker

View File

@ -53,7 +53,7 @@ def list_sessions(request, purchase_id=None):
dataset = Session.objects.filter(purchase=purchase_id)
context["purchase"] = Purchase.objects.get(id=purchase_id)
else:
dataset = Session.objects.all()
dataset = Session.objects.all().order_by("timestamp_start")
for session in dataset:
if session.timestamp_end == None and session.duration_manual == None: