bsw@450: local member = app.session.member bsw@450: local initiative = Initiative:by_id(param.get_id()) bsw@450: bsw@450: local ignore_initiative = IgnoredInitiative:by_pk(member.id, initiative.id) bsw@450: bsw@450: if param.get("delete", atom.boolean) then bsw@450: if ignore_initiative then bsw@450: ignore_initiative:destroy() bsw@450: end bsw@450: return bsw@450: end bsw@450: bsw@450: if not ignore_initiative then bsw@450: ignore_initiative = IgnoredInitiative:new() bsw@450: ignore_initiative.member_id = member.id bsw@450: ignore_initiative.initiative_id = initiative.id bsw@450: ignore_initiative:save() bsw@450: end bsw@450: bsw@450: