From: Magnus Hagander Date: Mon, 29 Oct 2018 11:48:35 +0000 (+0100) Subject: Also don't fail on invalid reviewers or authors X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=8761e5790820aa51eee7156505fe472c20ca8a5a;p=pgcommitfest2.git Also don't fail on invalid reviewers or authors Same fix as the previous one for status, but applies to the other two filter-by-dropdown fields. --- diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index cc94950..8ead84d 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -125,8 +125,8 @@ def commitfest(request, cfid): whereparams['self'] = request.user.id else: try: - whereclauses.append("EXISTS (SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(author)s)") whereparams['author'] = int(request.GET['author']) + whereclauses.append("EXISTS (SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(author)s)") except ValueError: # int() failed -- so just ignore this filter pass @@ -142,8 +142,8 @@ def commitfest(request, cfid): whereparams['self'] = request.user.id else: try: - whereclauses.append("EXISTS (SELECT 1 FROM commitfest_patch_reviewers cpr WHERE cpr.patch_id=p.id AND cpr.user_id=%(reviewer)s)") whereparams['reviewer'] = int(request.GET['reviewer']) + whereclauses.append("EXISTS (SELECT 1 FROM commitfest_patch_reviewers cpr WHERE cpr.patch_id=p.id AND cpr.user_id=%(reviewer)s)") except ValueError: # int() failed -- so just ignore this filter pass