Also don't fail on invalid reviewers or authors
authorMagnus Hagander <magnus@hagander.net>
Mon, 29 Oct 2018 11:48:35 +0000 (12:48 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 29 Oct 2018 11:48:35 +0000 (12:48 +0100)
Same fix as the previous one for status, but applies to the other two
filter-by-dropdown fields.

pgcommitfest/commitfest/views.py

index cc94950571a8d9269b15ad94c0731e0024e4596d..8ead84db5574693de5070afa472026a6dcb4581e 100644 (file)
@@ -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