Commit 158e1a32 authored by Tanner Prestegard's avatar Tanner Prestegard

Adding response status to FakeResponse

parent dd0ae853
......@@ -125,7 +125,9 @@ class ProxyHTTPSConnection(ProxyHTTPConnection):
# Hacky fake response type for kludging response object
# Has json() and read() methods
class FakeResponse(object):
def __init__(self, json, *args, **kwargs): self._data = json
def __init__(self, json, status, *args, **kwargs):
self._data = json
self.status = status
def json(self): return self._data
def read(self): return json.dumps(self._data)
......@@ -1633,7 +1635,7 @@ class GraceDb(GsiRest):
file_text = self.files(object_id, r_json['filename']).read()
r_json[u'text'] = file_text.decode()
response = FakeResponse(r_json)
response = FakeResponse(r_json, response.status)
# Return response
return response
......@@ -1742,7 +1744,7 @@ class GraceDb(GsiRest):
file_text = self.files(object_id, r_json['filename']).read()
r_json[u'text'] = file_text.decode()
response = FakeResponse(r_json)
response = FakeResponse(r_json, response.status)
return response
......
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