chore: Fixtures and empty state handling in chart widgets

This commit is contained in:
marination
2020-05-15 13:21:58 +05:30
parent 3f7678416f
commit be5c45a9ae
6 changed files with 221 additions and 1 deletions

View File

@@ -25,6 +25,10 @@ def get(chart_name = None, chart = None, no_cache = None, filters = None, from_d
wh["balance"] = balance[0][0]
warehouses = [x for x in warehouses if not (x.get('balance') == None)]
if not warehouses:
return []
sorted_warehouse_map = sorted(warehouses, key = lambda i: i['balance'],reverse=True)
if len(sorted_warehouse_map) > 10: