From 1a8c8786cce9fc807a5fdd8aa0e3bbbdec0b1e8c Mon Sep 17 00:00:00 2001 From: esp Date: Sat, 5 Sep 2015 22:17:21 +0800 Subject: [PATCH] =?UTF-8?q?update=20views.py=20=E8=BF=99=E4=B8=AA=E8=BF=98?= =?UTF-8?q?=E6=9C=89=E5=88=9A=E5=88=9A=E4=BF=AE=E6=94=B9=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=98=AF=E4=B8=BA=E4=BA=86=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9C=AA=E7=99=BB=E5=BD=95=E6=98=AF=E4=BC=A0?= =?UTF-8?q?=E5=85=A5join=E5=8F=82=E6=95=B0=EF=BC=8C=E5=B0=86=E5=BC=95?= =?UTF-8?q?=E5=8F=91500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contest/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contest/views.py b/contest/views.py index 58fcf5d..2c03f75 100644 --- a/contest/views.py +++ b/contest/views.py @@ -357,7 +357,7 @@ def contest_list_page(request, page=1): # 筛选我能参加的比赛 join = request.GET.get("join", None) - if join and request.user.id: + if request.user.is_authenticated and join: contests = contests.filter(Q(contest_type__in=[1, 2]) | Q(groups__in=request.user.group_set.all())). \ filter(end_time__gt=datetime.datetime.now(), start_time__lt=datetime.datetime.now())