Commit 429b195b authored by Adrià Labay's avatar Adrià Labay
Browse files

modify return code and condition

parent 95494625
......@@ -98,11 +98,9 @@ class Problems(Resource):
return dict(status=400, message=msg), 400
page_size = current_app.config['PAGE_FORMATS'][current_app.config['PAGE_FORMAT']]
if not (args['x'] >= 0 and
args['y'] >= 0 and
args['width'] + args['x'] < page_size[0] and
args['height'] + args['y'] < page_size[1]):
return dict(status=400, message='Problem size exceeds the page size.'), 400
if not (0 <= args['x'] < args['width'] + args['x'] < page_size[0] and
0 <= args['y'] < args['height'] + args['y'] < page_size[1]):
return dict(status=409, message='Problem size exceeds the page size.'), 409
widget = ProblemWidget(
x=args['x'],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment