diff --git a/gns3server/handlers/api/controller/project_handler.py b/gns3server/handlers/api/controller/project_handler.py index c6baf615..07ddad03 100644 --- a/gns3server/handlers/api/controller/project_handler.py +++ b/gns3server/handlers/api/controller/project_handler.py @@ -231,7 +231,6 @@ class ProjectHandler: controller = Controller.instance() project = controller.get_project(request.match_info["project_id"]) - started = False for data in project.export(include_images=bool(request.GET.get("include_images", "0"))): diff --git a/gns3server/web/route.py b/gns3server/web/route.py index 22bad4c0..2e30acf2 100644 --- a/gns3server/web/route.py +++ b/gns3server/web/route.py @@ -161,15 +161,15 @@ class Route(object): if response: return response - # Non API call - if api_version is None or raw is True: - response = Response(request=request, route=route, output_schema=output_schema) - - yield from func(request, response) - return response - - # API call try: + # Non API call + if api_version is None or raw is True: + response = Response(request=request, route=route, output_schema=output_schema) + + yield from func(request, response) + return response + + # API call if "controller" in func.__module__ and server_config.getboolean("controller", False) is False: raise aiohttp.web.HTTPForbidden(text="The server is not a controller")