Skip to content
Snippets Groups Projects
Commit 54a4d64b authored by Theodore Chang's avatar Theodore Chang
Browse files

Minor update

parent 230009b6
No related branches found
No related tags found
1 merge request!2212Minor update
Pipeline #227710 passed
...@@ -41,13 +41,6 @@ default_tag = 'graph' ...@@ -41,13 +41,6 @@ default_tag = 'graph'
ENCODERS_BY_TYPE[LazyUserWrapper] = lambda v: v.to_json() ENCODERS_BY_TYPE[LazyUserWrapper] = lambda v: v.to_json()
def normalise_response(response):
if GeneralReader.__CACHE__ in response:
del response[GeneralReader.__CACHE__]
return response
def unwrap_response(result): def unwrap_response(result):
if isinstance(result, dict): if isinstance(result, dict):
for key, value in result.items(): for key, value in result.items():
...@@ -65,7 +58,9 @@ def unwrap_response(result): ...@@ -65,7 +58,9 @@ def unwrap_response(result):
class GraphJSONResponse(ORJSONResponse): class GraphJSONResponse(ORJSONResponse):
def render(self, content): def render(self, content):
unwrap_response(normalise_response(content)) content.pop(GeneralReader.__CACHE__, None)
unwrap_response(content)
return super().render(content) return super().render(content)
...@@ -117,7 +112,7 @@ async def basic_query( ...@@ -117,7 +112,7 @@ async def basic_query(
except Exception as e: except Exception as e:
raise HTTPException(422, detail=str(e)) raise HTTPException(422, detail=str(e))
return normalise_response(response) return GraphJSONResponse(response)
@router.post( @router.post(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment