# HG changeset patch # User bsw # Date 1345424370 -7200 # Node ID 941941955c0e31f1e3b2593c154a0104a79443ee # Parent 6ba4ebe7b707dfbf74247d769d5d08f546de30d4 Allow (un)set of non_voter only while voting is running diff -r 6ba4ebe7b707 -r 941941955c0e app/main/vote/_action/non_voter.lua --- a/app/main/vote/_action/non_voter.lua Mon Aug 20 02:59:05 2012 +0200 +++ b/app/main/vote/_action/non_voter.lua Mon Aug 20 02:59:30 2012 +0200 @@ -1,5 +1,15 @@ local issue = Issue:new_selector():add_where{ "id = ?", param.get("issue_id", atom.integer) }:for_share():single_object_mode():exec() +if issue.closed then + slot.put_into("error", _"This issue is already closed.") + return false +end + +if issue.state ~= "voting" then + slot.put_into("error", _"Voting has not started yet.") + return false +end + local direct_voter = DirectVoter:by_pk(issue.id, app.session.member_id) if direct_voter then