From 5fd734dc4e4fb04a92cd29b711c2475d11f03e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sat, 28 Dec 2019 22:40:33 +0100 Subject: [PATCH] update finanzer routes if finanzer add credit or amount to a user, he get all creditList of all years of the user --- geruecht/finanzer/routes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geruecht/finanzer/routes.py b/geruecht/finanzer/routes.py index 9363617..a7cb678 100644 --- a/geruecht/finanzer/routes.py +++ b/geruecht/finanzer/routes.py @@ -69,7 +69,8 @@ def _addAmount(): LOGGER.error("KeyError in month. Month is set to default.") month = datetime.now().month LOGGER.debug("Year is {} and Month is {}".format(year, month)) - retVal = userController.addAmount(userID, amount, year=year, month=month).toJSON() + userController.addAmount(userID, amount, year=year, month=month) + retVal = {geruecht.year: geruecht.toJSON() for geruecht in userController.getUser(userID).geruechte} LOGGER.info("Send updated Geruecht") return jsonify(retVal) LOGGER.info("Permission Denied") @@ -114,6 +115,7 @@ def _addCredit(): LOGGER.debug("Year is {} and Month is {}".format(year, month)) retVal = userController.addCredit(userID, credit, year=year, month=month).toJSON() + retVal = {geruecht.year: geruecht.toJSON() for geruecht in userController.getUser(userID).geruechte} LOGGER.info("Send updated Geruecht") return jsonify(retVal) LOGGER.info("Permission Denied")