From 4a6e672630aee4b6de2935ca82d53366215bd5fc Mon Sep 17 00:00:00 2001 From: jtc42 Date: Mon, 6 Jan 2020 17:23:37 +0000 Subject: [PATCH] Marshal with TaskSchema --- openflexure_microscope/api/default_extensions/scan.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/api/default_extensions/scan.py b/openflexure_microscope/api/default_extensions/scan.py index 0cf42084..62af7d4a 100644 --- a/openflexure_microscope/api/default_extensions/scan.py +++ b/openflexure_microscope/api/default_extensions/scan.py @@ -11,6 +11,8 @@ from openflexure_microscope.common.flask_labthings.find import ( find_extension, ) from openflexure_microscope.common.flask_labthings.extensions import BaseExtension +from openflexure_microscope.common.flask_labthings.views.tasks import TaskSchema +from openflexure_microscope.common.flask_labthings.decorators import marshal_with from openflexure_microscope.devel import ( JsonResponse, @@ -344,6 +346,7 @@ def stack( class TileScanAPI(Resource): + @marshal_with(TaskSchema()) def post(self): payload = JsonResponse(request) microscope = find_device("openflexure_microscope") @@ -398,7 +401,7 @@ class TileScanAPI(Resource): ) # return a handle on the scan task - return jsonify(task.state), 201 + return task scan_extension_v2 = BaseExtension("scan")