增加访问首页的参数

This commit is contained in:
virusdefender
2015-11-27 22:23:00 +08:00
parent 6f57641120
commit e7afceea9e

View File

@@ -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/')