liquid_feedback_frontend

changeset 521:75a95999a410

Fixed error when discard voting
author bsw
date Mon Apr 16 23:43:38 2012 +0200 (2012-04-16)
parents f9b80c930456
children a930d2ab9e76
files app/main/vote/_action/update.lua
line diff
     1.1 --- a/app/main/vote/_action/update.lua	Mon Apr 16 23:28:58 2012 +0200
     1.2 +++ b/app/main/vote/_action/update.lua	Mon Apr 16 23:43:38 2012 +0200
     1.3 @@ -14,6 +14,15 @@
     1.4    return false
     1.5  end
     1.6  
     1.7 +local direct_voter = DirectVoter:by_pk(issue.id, app.session.member_id)
     1.8 +
     1.9 +if param.get("discard", atom.boolean) then
    1.10 +  if direct_voter then
    1.11 +    direct_voter:destroy()
    1.12 +  end
    1.13 +  slot.put_into("notice", _"Your vote has been discarded. Delegation rules apply if set.")
    1.14 +  return
    1.15 +end
    1.16  
    1.17  local move_up 
    1.18  local move_down
    1.19 @@ -33,16 +42,6 @@
    1.20  end
    1.21  
    1.22  if not move_down and not move_up then
    1.23 -  local direct_voter = DirectVoter:by_pk(issue.id, app.session.member_id)
    1.24 -
    1.25 -  if param.get("discard", atom.boolean) then
    1.26 -    if direct_voter then
    1.27 -      direct_voter:destroy()
    1.28 -    end
    1.29 -    slot.put_into("notice", _"Your vote has been discarded. Delegation rules apply if set.")
    1.30 -    return
    1.31 -  end
    1.32 -
    1.33    if not direct_voter then
    1.34      direct_voter = DirectVoter:new()
    1.35      direct_voter.issue_id = issue.id

Impressum / About Us