From b8a15e43db5dc48863780a2f1aec4d50dd7d5c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 4 Jan 2023 19:35:35 +0100 Subject: [PATCH] Redirect after adding game/platform/purchase/session --- CHANGELOG.md | 1 + Dockerfile | 2 +- src/web/tracker/views.py | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da7befc..b9a0b1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Unreleased +* Redirect after adding game/platform/purchase/session * Fix display of duration_manual * Fix display of duration_calculated, display durations less than a minute * Make the "Finish now?" button on session list work diff --git a/Dockerfile b/Dockerfile index ccf2f9c..281316a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,5 +12,5 @@ COPY entrypoint.sh / RUN chmod +x /entrypoint.sh USER timetracker EXPOSE 8000 -ENV VERSION_NUMBER 0.1.0-16-g12cc902 +ENV VERSION_NUMBER 0.1.0-17-ga1309c3 ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/src/web/tracker/views.py b/src/web/tracker/views.py index 491dec4..ef019ec 100644 --- a/src/web/tracker/views.py +++ b/src/web/tracker/views.py @@ -24,6 +24,7 @@ def add_session(request): form = SessionForm(request.POST or None, initial=initial) if form.is_valid(): form.save() + return redirect("list_sessions") context["form"] = form return render(request, "add_session.html", context) @@ -62,6 +63,7 @@ def add_purchase(request): form = PurchaseForm(request.POST or None, initial=initial) if form.is_valid(): form.save() + return redirect("index") context["form"] = form context["title"] = "Add New Purchase" @@ -73,6 +75,7 @@ def add_game(request): form = GameForm(request.POST or None) if form.is_valid(): form.save() + return redirect("index") context["form"] = form context["title"] = "Add New Game" @@ -84,6 +87,7 @@ def add_platform(request): form = PlatformForm(request.POST or None) if form.is_valid(): form.save() + return redirect("index") context["form"] = form context["title"] = "Add New Platform"