From 84151808c02beacac4395c506189ee743bc9f260 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 16 Sep 2018 23:47:52 +0200 Subject: [PATCH] Don't fail on incorrect statuses in URL The comment said we should ignore the status if int() on it fails, but to do that we have to fail it before we actually add the WHERE clause. Thus, reorder the code to do so. --- pgcommitfest/commitfest/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index 3ee60e3..cc94950 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -108,8 +108,8 @@ def commitfest(request, cfid): whereparams = {} if request.GET.has_key('status') and request.GET['status'] != "-1": try: - whereclauses.append("poc.status=%(status)s") whereparams['status'] = int(request.GET['status']) + whereclauses.append("poc.status=%(status)s") except ValueError: # int() failed -- so just ignore this filter pass -- 2.39.5