Fixed to return as JSON in the get_summary_categories() utility in the accounting application.

This commit is contained in:
依瑪貓 2020-08-05 00:28:43 +08:00
parent 4f7c338dfd
commit 2c6256b497

View File

@ -361,8 +361,8 @@ def get_summary_categories():
if row["category"] not in categories[key]: if row["category"] not in categories[key]:
categories[key][row["category"]] = row["account__code"] categories[key][row["category"]] = row["account__code"]
# Converts the dictionary to a list, as the category may not be US-ASCII # Converts the dictionary to a list, as the category may not be US-ASCII
return {t: [[c, categories[t][c]] for c in categories[t]] return json.dumps({t: [[c, categories[t][c]] for c in categories[t]]
for t in categories.keys()} for t in categories.keys()})
def fill_txn_from_post(txn_type, txn, post): def fill_txn_from_post(txn_type, txn, post):