COPYRIGHTLINK="https://wpia.club"
IMPRINTLINK="https://documents.wpia.club/imprint.html"
DATAPROTECTIONLINK="https://documents.wpia.club/data_privacy_policy_html_pages_en.html"
+ MAX_PROXY=2
# Load config
if may("audit", resultmotion[0].get("type")) and not resultmotion[0].get("running") and not resultmotion[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")(resultmotion[0].get("id"));
votes = get_db().prepare("SELECT vote.result, voter.email, CASE voter.email WHEN proxy.email THEN NULL ELSE proxy.email END as proxyemail FROM vote INNER JOIN voter ON voter.id = vote.voter_id INNER JOIN voter as proxy ON proxy.id = vote.proxy_id WHERE vote.motion_id=$1")(resultmotion[0].get("id"));
- return render_template('single_motion.html', motion=resultmotion[0], may_vote=may("vote", resultmotion[0].get("type")), may_cancel=may("cancel", resultmotion[0].get("type")), votes=votes, proxyvote=resultproxyvote, proxyname=resultproxyname, languages=get_languages())
+ return render_template('single_motion.html', motion=resultmotion[0], may_vote=may("vote", resultmotion[0].get("type")), may_cancel=may("cancel", resultmotion[0].get("type")), may_finish=may("finish", resultmotion[0].get("type")), votes=votes, proxyvote=resultproxyvote, proxyname=resultproxyname, languages=get_languages())
@app.route("/motion/<string:motion>/vote/<string:voter>", methods=['POST'])
@validate_motion_access_vote('vote')
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")
db = get_db()
with db.xact():
rv = db.prepare("SELECT id FROM voter WHERE lower(email)=lower($1)")(email)
- messagetext="User '%s' already exists." % (email)
+ messagetext=_("User '%s' already exists.") % (email)
if len(rv) == 0:
db.prepare("INSERT INTO voter(\"email\") VALUES($1)")(email)
- messagetext="User '%s' inserted." % (email)
+ messagetext=_("User '%s' inserted.") % (email)
click.echo(messagetext)