liquid_feedback_frontend

diff app/main/opinion/_action/update.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents 1997cf1da04b
children 32cc544d5a5b
line diff
     1.1 --- a/app/main/opinion/_action/update.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/opinion/_action/update.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -6,6 +6,10 @@
     1.4  
     1.5  local suggestion = Suggestion:by_id(suggestion_id)
     1.6  
     1.7 +local degree = param.get("degree", atom.number)
     1.8 +local fulfilled = param.get("fulfilled", atom.boolean)
     1.9 +
    1.10 +
    1.11  if not suggestion then
    1.12    slot.put_into("error", _"This suggestion has been meanwhile deleted")
    1.13    return false
    1.14 @@ -28,7 +32,7 @@
    1.15    return false
    1.16  end
    1.17  
    1.18 -if param.get("delete") then
    1.19 +if degree == 0 then
    1.20    if opinion then
    1.21      opinion:destroy()
    1.22    end
    1.23 @@ -36,9 +40,6 @@
    1.24    return
    1.25  end
    1.26  
    1.27 -local degree = param.get("degree", atom.number)
    1.28 -local fulfilled = param.get("fulfilled", atom.boolean)
    1.29 -
    1.30  if degree ~= 0 and not app.session.member:has_voting_right_for_unit_id(suggestion.initiative.issue.area.unit_id) then
    1.31    error("access denied")
    1.32  end

Impressum / About Us