Re-introduce index view
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8dcbe2f0ad
commit
d4ab0596da
|
@ -3,7 +3,13 @@ from django.urls import path
|
|||
from games import views
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.list_sessions, {"filter": "recent"}, name="list_sessions_recent"),
|
||||
path("", views.index, name="index"),
|
||||
path(
|
||||
"list-sessions/recent",
|
||||
views.list_sessions,
|
||||
{"filter": "recent"},
|
||||
name="list_sessions_recent",
|
||||
),
|
||||
path("add-game/", views.add_game, name="add_game"),
|
||||
path("add-platform/", views.add_platform, name="add_platform"),
|
||||
path("add-session/", views.add_session, name="add_session"),
|
||||
|
|
|
@ -117,7 +117,7 @@ def add_purchase(request):
|
|||
form = PurchaseForm(request.POST or None, initial=initial)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect("list_sessions")
|
||||
return redirect("index")
|
||||
|
||||
context["form"] = form
|
||||
context["title"] = "Add New Purchase"
|
||||
|
@ -129,7 +129,7 @@ def add_game(request):
|
|||
form = GameForm(request.POST or None)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect("list_sessions")
|
||||
return redirect("index")
|
||||
|
||||
context["form"] = form
|
||||
context["title"] = "Add New Game"
|
||||
|
@ -153,8 +153,12 @@ def add_platform(request):
|
|||
form = PlatformForm(request.POST or None)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect("list_sessions")
|
||||
return redirect("index")
|
||||
|
||||
context["form"] = form
|
||||
context["title"] = "Add New Platform"
|
||||
return render(request, "add.html", context)
|
||||
|
||||
|
||||
def index(request):
|
||||
return redirect("list_sessions_recent")
|
||||
|
|
Loading…
Reference in New Issue