Redirect after adding game/platform/purchase/session

This commit is contained in:
Lukáš Kucharczyk 2023-01-04 19:35:35 +01:00
parent a1309c3738
commit b8a15e43db
3 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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" ]

View File

@ -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"