From: Felix Dörre Date: Wed, 9 Dec 2020 20:26:36 +0000 (+0100) Subject: another small testcase fix X-Git-Url: https://code.wpia.club/?p=motion.git;a=commitdiff_plain;h=d4e0c331afc48405981dea20b0311b50d7e075a3 another small testcase fix --- diff --git a/motion.py b/motion.py index 82efd00..1f276e1 100644 --- a/motion.py +++ b/motion.py @@ -422,7 +422,7 @@ def add_proxy(): return _('Error, proxy allready given.'), 400 rv = get_db().prepare("SELECT COUNT(id) as c FROM proxy WHERE proxy_id=$1 AND revoked is NULL GROUP BY proxy_id")(proxyid); if len(rv) != 0: - if rv[0].get("c") >= max_proxy: + if rv[0].get("c") is None or rv[0].get("c") >= max_proxy: return _("Error, Max proxy for '%s' reached.") % (proxy), 400 rv = get_db().prepare("INSERT INTO proxy(voter_id, proxy_id, granted_by) VALUES ($1,$2,$3)")(voterid, proxyid, g.voter) return rel_redirect("/proxy")