From 550e44d93a91fc4b32769a5c219c75cbb86ae390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 9 Aug 2020 18:55:30 +0800 Subject: [PATCH] Replaced the links to the home page with the view name. --- mia_core/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mia_core/views.py b/mia_core/views.py index 80b930a..95f2573 100644 --- a/mia_core/views.py +++ b/mia_core/views.py @@ -23,6 +23,7 @@ from django.contrib.auth import logout as logout_user from django.contrib.messages.views import SuccessMessageMixin from django.http import HttpResponse from django.shortcuts import redirect +from django.urls import reverse from django.views.decorators.http import require_POST from django.views.generic import DeleteView as CoreDeleteView @@ -50,7 +51,7 @@ def logout(request): if "next" in request.POST: request.session["logout"] = True return redirect(request.POST["next"]) - return redirect("/") + return redirect(reverse("home")) # TODO: To be removed.