

@require_admin
def post(self, group_id):
    user_id = request.json['user_id']
    user = models.User.get_by_id_and_org(user_id, self.current_org)
    group = models.Group.get_by_id_and_org(group_id, group.current_org)
    user.groups.append(group.id)
    user.save()
    self.record_event({
        'action': 'add_member',
        'timestamp': int(time.time()),
        'object_id': group.id,
        'object_type': 'group',
        'member_id': user.id,
    })
    return user.to_dict()

dataset/ETHPy150Open getredash/redash/redash/handlers/groups.py GroupMemberListResource.post/VarMisuse@49/72 `self`->`group`