From: Felix Dörre Date: Mon, 27 Nov 2017 13:29:26 +0000 (+0100) Subject: chg: only allow 'audit' on finished votes X-Git-Url: https://code.wpia.club/?p=motion.git;a=commitdiff_plain;h=89c2a5c21312ad5325e8c3bc8e2dbda647be5c13 chg: only allow 'audit' on finished votes --- diff --git a/motion.py b/motion.py index 957bf96..e18ceef 100644 --- a/motion.py +++ b/motion.py @@ -147,7 +147,7 @@ def show_motion(motion): + "WHERE motion.id=$1") rv = p(motion, g.voter) votes = None - if may("audit", rv[0].get("type")): + if may("audit", rv[0].get("type")) and not rv[0].get("running") and not rv[0].get("canceled"): votes = get_db().prepare("SELECT vote.result, voter.email FROM vote INNER JOIN voter ON voter.id = vote.voter_id WHERE vote.motion_id=$1")(motion); return render_template('single_motion.html', motion=rv[0], may_vote=may("vote", rv[0].get("type")), may_cancel=may("cancel", rv[0].get("type")), votes=votes)