Updated todo

This commit is contained in:
jtc42 2018-11-16 08:34:55 +00:00
parent 0914894f9c
commit e8446ad66d

View file

@ -219,6 +219,7 @@ class CaptureListAPI(MicroscopeView):
""" """
state = parse_payload(request) state = parse_payload(request)
# TODO: Roll all of these ugly if statements into a method for getting payload elements
if 'filename' in state: if 'filename' in state:
filename = state['filename'] filename = state['filename']
else: else:
@ -238,6 +239,7 @@ class CaptureListAPI(MicroscopeView):
if 'width' in state['size'] and 'height' in state['size']: if 'width' in state['size'] and 'height' in state['size']:
resize = (state['size']['width'], state['size']['height']) resize = (state['size']['width'], state['size']['height'])
else: else:
# TODO: Return error 4XX instead of exception
raise Exception("Invalid resize parameters passed. Ensure both width and height are specified.") raise Exception("Invalid resize parameters passed. Ensure both width and height are specified.")
else: else:
resize = None resize = None