X-Git-Url: https://code.wpia.club/?p=motion.git;a=blobdiff_plain;f=motion.py;h=8eaa3501214926263fa271255c2fdf90633a1c38;hp=82efd0021cef93a1ed51c7abf958059657e24e12;hb=f3cf764d5e9ab3f2fa1327dc5db02de90fd91434;hpb=65f725a29286db658c4c2c28b7502270fc5de748 diff --git a/motion.py b/motion.py index 82efd00..8eaa350 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") @@ -453,8 +453,8 @@ def create_user(email): 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)