From e8446ad66daa39137b3a65d2e6713b4985569e32 Mon Sep 17 00:00:00 2001 From: jtc42 Date: Fri, 16 Nov 2018 08:34:55 +0000 Subject: [PATCH] Updated todo --- openflexure_microscope/api/v1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openflexure_microscope/api/v1.py b/openflexure_microscope/api/v1.py index acce7fad..6e287473 100644 --- a/openflexure_microscope/api/v1.py +++ b/openflexure_microscope/api/v1.py @@ -219,6 +219,7 @@ class CaptureListAPI(MicroscopeView): """ state = parse_payload(request) + # TODO: Roll all of these ugly if statements into a method for getting payload elements if 'filename' in state: filename = state['filename'] else: @@ -238,6 +239,7 @@ class CaptureListAPI(MicroscopeView): if 'width' in state['size'] and 'height' in state['size']: resize = (state['size']['width'], state['size']['height']) else: + # TODO: Return error 4XX instead of exception raise Exception("Invalid resize parameters passed. Ensure both width and height are specified.") else: resize = None