def delete(self, request, group_id, email, format=None):
    ' Delete an user from group\n\n        Permission checking:\n        1. only admin can perform this action.\n        '
    if (not request.user.admin_permissions.can_manage_group()):
        return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
    group_id = int(group_id)
    group = ccnet_api.get_group(group_id)
    if (not group):
        error_msg = ('Group %d not found.' % group_id)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    try:
        if (not is_group_member(group_id, email)):
            return Response({'success': True})
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    if (group.creator_name == email):
        error_msg = ('%s is group owner, can not be removed.' % email)
        return api_error(status.HTTP_403_FORBIDDEN, error_msg)
    try:
        ccnet_api.group_remove_member(group_id, group.creator_name, email)
        seafile_api.remove_group_repos_by_owner(group_id, email)
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    return Response({'success': True})
Delete an user from group

Permission checking:
1. only admin can perform this action.
def delete(self, request, group_id, email, format=None):
    ' Delete an user from group\n\n        Permission checking:\n        1. only admin can perform this action.\n        '
    if (not request.user.admin_permissions.can_manage_group()):
        return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
    group_id = int(group_id)
    group = ccnet_api.get_group(group_id)
    if (not group):
        error_msg = ('Group %d not found.' % group_id)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    try:
        if (not is_group_member(group_id, email)):
            return Response({'success': True})
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    if (group.creator_name == email):
        error_msg = ('%s is group owner, can not be removed.' % email)
        return api_error(status.HTTP_403_FORBIDDEN, error_msg)
    try:
        ccnet_api.group_remove_member(group_id, group.creator_name, email)
        seafile_api.remove_group_repos_by_owner(group_id, email)
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    return Response({'success': True})