refactor: grouper function to fix priority keys (#415)

This commit is contained in:
pablohashescobar 2023-03-15 23:24:55 +05:30 committed by GitHub
parent 5d8f2b6b75
commit 46f6b61928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,15 @@ def group_results(results_data, group_by):
"""
response_dict = dict()
if group_by == "priority":
response_dict = {
"urgent": [],
"high": [],
"medium": [],
"low": [],
"None": [],
}
for value in results_data:
group_attribute = resolve_keys(group_by, value)
if isinstance(group_attribute, list):