Remove redundant Response wraps
This commit is contained in:
parent
5ec0dd7418
commit
9451d4df95
@ -503,10 +503,7 @@ class SyncApp(object):
|
|||||||
if url == 'hostKey':
|
if url == 'hostKey':
|
||||||
result = self.operation_hostKey(data.get("u"), data.get("p"))
|
result = self.operation_hostKey(data.get("u"), data.get("p"))
|
||||||
if result:
|
if result:
|
||||||
return Response(
|
return json.dumps(result)
|
||||||
status='200 OK',
|
|
||||||
content_type='application/json',
|
|
||||||
body=json.dumps(result))
|
|
||||||
else:
|
else:
|
||||||
# TODO: do I have to pass 'null' for the client to receive None?
|
# TODO: do I have to pass 'null' for the client to receive None?
|
||||||
raise HTTPForbidden('null')
|
raise HTTPForbidden('null')
|
||||||
@ -559,18 +556,12 @@ class SyncApp(object):
|
|||||||
elif url == 'upload':
|
elif url == 'upload':
|
||||||
thread = session.get_thread()
|
thread = session.get_thread()
|
||||||
result = thread.execute(self.operation_upload, [data['data'], session])
|
result = thread.execute(self.operation_upload, [data['data'], session])
|
||||||
return Response(
|
return result
|
||||||
status='200 OK',
|
|
||||||
content_type='text/plain',
|
|
||||||
body=result)
|
|
||||||
|
|
||||||
elif url == 'download':
|
elif url == 'download':
|
||||||
thread = session.get_thread()
|
thread = session.get_thread()
|
||||||
result = thread.execute(self.operation_download, [session])
|
result = thread.execute(self.operation_download, [session])
|
||||||
return Response(
|
return result
|
||||||
status='200 OK',
|
|
||||||
content_type='text/plain',
|
|
||||||
body=result)
|
|
||||||
|
|
||||||
# This was one of our operations but it didn't get handled... Oops!
|
# This was one of our operations but it didn't get handled... Oops!
|
||||||
raise HTTPInternalServerError()
|
raise HTTPInternalServerError()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user