From cd9647463bf8756b822a1f1e692f8a684d6ec70e Mon Sep 17 00:00:00 2001 From: Zhao-Linux Date: Mon, 10 Oct 2022 14:07:50 +0700 Subject: [PATCH] Fix typo --- judge/models/contest.py | 4 ++-- judge/views/blog.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/judge/models/contest.py b/judge/models/contest.py index 0e86dad..8b90f77 100644 --- a/judge/models/contest.py +++ b/judge/models/contest.py @@ -536,8 +536,8 @@ class Contest(models.Model): return False @classmethod - def get_visible_contests(cls, user, *args): - if not user.is_authenticated or args == (True,) : + def get_visible_contests(cls, user, show_own_contests_only=False): + if not user.is_authenticated or show_own_contests_only: return ( cls.objects.filter( is_visible=True, is_organization_private=False, is_private=False diff --git a/judge/views/blog.py b/judge/views/blog.py index 4753563..b3f508d 100644 --- a/judge/views/blog.py +++ b/judge/views/blog.py @@ -70,7 +70,7 @@ class FeedView(ListView): now = timezone.now() visible_contests = ( - Contest.get_visible_contests(self.request.user, True) + Contest.get_visible_contests(self.request.user, show_own_contests_only=True) .filter(is_visible=True) .order_by("start_time") )