From e7afceea9ee8fe6ce251ea1e58fdfa0a563a1119 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Fri, 27 Nov 2015 22:23:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BF=E9=97=AE=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account/views.py b/account/views.py index ac8ebdf..5edcd1e 100644 --- a/account/views.py +++ b/account/views.py @@ -62,10 +62,9 @@ def index_page(request): if not request.user.is_authenticated(): return render(request, "oj/index.html") - try: - if request.META['HTTP_REFERER']: + if request.META.get('HTTP_REFERER') or request.GET.get("index"): return render(request, "oj/index.html") - except KeyError: + else: return http.HttpResponseRedirect('/problems/')