liquid_feedback_frontend
view app/main/membership/_action/update.lua @ 1450:2fbf95bee380
Fixed missing closing end
| author | bsw | 
|---|---|
| date | Thu Oct 18 17:17:32 2018 +0200 (2018-10-18) | 
| parents | 701a5cf6b067 | 
| children | 
 line source
     1 local area_id = assert(param.get("area_id", atom.integer), "no area id given")
     2 local membership = Membership:by_pk(area_id, app.session.member.id)
     4 local area = Area:by_id(area_id)
     5 if param.get("delete", atom.boolean) then
     6   if membership then
     7     membership:destroy()
     8     slot.put_into("notice", _"Subscription removed")
     9   else
    10     slot.put_into("notice", _"Subscription already removed")
    11   end
    12   return
    13 end
    15 if not app.session.member:has_voting_right_for_unit_id(area.unit_id) then
    16   slot.put_into("error", _"You are not eligible to participate")
    17   return false
    18 end
    20 if not membership then
    21   membership = Membership:new()
    22   membership.area_id    = area_id
    23   membership.member_id  = app.session.member_id
    24   membership:save()
    25   slot.put_into("notice", _"Subject area subscribed")
    26 end
