liquid_feedback_frontend
view app/main/member/_action/update_agent.lua @ 1753:85ee2f4ca9f2
Fixed worker name
| author | bsw | 
|---|---|
| date | Wed Oct 13 13:33:23 2021 +0200 (2021-10-13) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     1 if not config.role_registration then
     2   return
     3 end
     4 if not app.session.member.role then
     5   return
     6 end
     8 local controller_id = param.get("controller_id")
    10 local member = Member:by_id(controller_id)
    12 if member.role then
    13   return
    14 end
    16 local agent = Agent:by_pk(app.session.member_id, controller_id)
    18 if param.get("delete") then
    19   agent:destroy()
    20   return
    21 end
    23 if not agent then
    24   agent = Agent:new()
    25   agent.controlled_id = app.session.member_id
    26   agent.controller_id = controller_id
    27   agent:save()
    28 end
