liquid_feedback_frontend
view app/main/initiative/_action/remove_support.lua @ 1566:7b7406a84346
Fixed layout of initiative admitted or revoked info
author | bsw |
---|---|
date | Tue Nov 10 21:14:35 2020 +0100 (2020-11-10) |
parents | 701a5cf6b067 |
children |
line source
1 local initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
3 -- TODO important m1 selectors returning result _SET_!
4 local issue = initiative:get_reference_selector("issue"):for_share():single_object_mode():exec()
6 if issue.closed then
7 slot.put_into("error", _"This issue is already closed.")
8 return false
9 elseif issue.fully_frozen then
10 slot.put_into("error", _"Voting for this issue has already begun.")
11 return false
12 elseif
13 (issue.half_frozen and issue.phase_finished) or
14 (not issue.accepted and issue.phase_finished)
15 then
16 slot.put_into("error", _"Current phase is already closed.")
17 return false
18 end
20 local member = app.session.member
22 local supporter = Supporter:by_pk(initiative.id, member.id)
24 if supporter then
25 supporter:destroy()
26 else
27 end