Skip to content
Snippets Groups Projects
Commit 693dac57 authored by Michelle Weidling's avatar Michelle Weidling :blowfish:
Browse files

refactor: name

parent 640c636a
No related branches found
No related tags found
No related merge requests found
Pipeline #509184 passed
......@@ -10,14 +10,14 @@ def remove_mongodb_id_from_result(json_data, result_type) -> list:
purged_list = []
for obj in json_data:
d = dict(obj)
remove_key_from_dict(d)
remove_keys_from_dict(d)
del d['_id']
if result_type == 'gt':
d = d['gt_workspace']
purged_list.append(d)
return purged_list
def remove_key_from_dict(d: dict) -> dict:
def remove_keys_from_dict(d: dict) -> dict:
"""
This function removes keys with the value of null from the result.
"""
......@@ -26,4 +26,4 @@ def remove_key_from_dict(d: dict) -> dict:
if d[key] == None:
del d[key]
else:
remove_key_from_dict(d[key])
remove_keys_from_dict(d[key])
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