liquid_feedback_frontend
view app/main/interest/_action/update_voting_requested.lua @ 170:da885b2dda29
remove author_id from suggestion until private api is done
| author | Daniel Poelzleithner <poelzi@poelzi.org> | 
|---|---|
| date | Sat Oct 09 22:13:32 2010 +0200 (2010-10-09) | 
| parents | 559c6be0e1e9 | 
| children | 
 line source
     1 local issue_id = assert(param.get("issue_id", atom.integer), "no issue id given")
     3 local interest = Interest:by_pk(issue_id, app.session.member.id)
     5 local issue = Issue:new_selector():add_where{ "id = ?", issue_id }:for_share():single_object_mode():exec()
     7 if issue.closed then
     8   slot.put_into("error", _"This issue is already closed.")
     9   return false
    10 elseif issue.half_frozen then 
    11   slot.put_into("error", _"This issue is already frozen.")
    12   return false
    13 end
    15 interest.voting_requested = param.get("voting_requested", atom.boolean)
    17 if interest.voting_requested == true then
    18   error("not implemented yet")
    19 end
    21 interest:save()
    23 slot.put_into("notice", _"Voting request updated")
