From 822eb7bfa73cc5e59d92beaa73e1e08073f9e8fc Mon Sep 17 00:00:00 2001 From: Lunaresk Date: Sat, 4 Dec 2021 13:02:54 +0100 Subject: [PATCH] fix: database result grouping --- server/src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main.py b/server/src/main.py index 2f33f88..9781bef 100644 --- a/server/src/main.py +++ b/server/src/main.py @@ -62,7 +62,7 @@ def get_monthly_report_from_user(user: str = None, year: int = None, month: int abort(400) LOGGER.info("Getting results.") results = DATABASE.get_report(user=user, year=year, month=month) - LOGGER.debug("Results get") + LOGGER.debug(f"Results received: {results}") if results: result_dict = group_results(results) else: @@ -76,7 +76,7 @@ def group_results(results: tuple) -> dict: for result in results: if result[0] not in result_dict: result_dict[result[0]] = {} - if result[1] not in result_dict[result[0]]: + if str(result[1]) not in result_dict[result[0]]: result_dict[result[0]][str(result[1])] = {} result_dict[result[0]][str(result[1])][result[2]] = ( result[3], result[4])