# HG changeset patch # User bsw # Date 1334612618 -7200 # Node ID 75a95999a4103a8cda9488c3f28264ea05e3de48 # Parent f9b80c930456aadc9b3abd06d79683cf20380405 Fixed error when discard voting diff -r f9b80c930456 -r 75a95999a410 app/main/vote/_action/update.lua --- a/app/main/vote/_action/update.lua Mon Apr 16 23:28:58 2012 +0200 +++ b/app/main/vote/_action/update.lua Mon Apr 16 23:43:38 2012 +0200 @@ -14,6 +14,15 @@ return false end +local direct_voter = DirectVoter:by_pk(issue.id, app.session.member_id) + +if param.get("discard", atom.boolean) then + if direct_voter then + direct_voter:destroy() + end + slot.put_into("notice", _"Your vote has been discarded. Delegation rules apply if set.") + return +end local move_up local move_down @@ -33,16 +42,6 @@ end if not move_down and not move_up then - local direct_voter = DirectVoter:by_pk(issue.id, app.session.member_id) - - if param.get("discard", atom.boolean) then - if direct_voter then - direct_voter:destroy() - end - slot.put_into("notice", _"Your vote has been discarded. Delegation rules apply if set.") - return - end - if not direct_voter then direct_voter = DirectVoter:new() direct_voter.issue_id = issue.id