only remove the user if they are member of the main members team
import json
import uuid
+from flask import current_app
from flask_hookserver import Hooks
from .db import redis
@@ -23,6 +24,10 @@ def membership(data, guid):
member = User.query.filter_by(id=data["member"]["id"]).first()
if member is None:
return
+ # only remove the user if they are member of the main members team
+ # not if they are removed from project teams
+ if data["team"]["slug"] != current_app.config["GITHUB_MEMBERS_TEAM_SLUG"]:
+ return
if data["action"] == "added":
member.is_member = True
member.save()
