- change message to "You cannot modify the membership of this team, because it maps to an external group.", and you can use this filter before :leave as well
- what is the return value of render_error? does it prevent the action from running?