From c7e1c981e6aa94025a90ec895a44c992964880c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Mon, 8 Jun 2020 00:03:27 +0200 Subject: [PATCH] =?UTF-8?q?fixed=20bug,=20dass=20auch=20der=20finanzer=20s?= =?UTF-8?q?chulden=20hinzuf=C3=BCgen=20kann=20ohne=20dass=20last=5Fseen=20?= =?UTF-8?q?aktualisiert=20wird?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- geruecht/baruser/routes.py | 2 +- .../controller/mainController/mainCreditListController.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/geruecht/baruser/routes.py b/geruecht/baruser/routes.py index d078bc6..484cf4f 100644 --- a/geruecht/baruser/routes.py +++ b/geruecht/baruser/routes.py @@ -77,7 +77,7 @@ def _baradd(**kwargs): amountl = amount date = datetime.now() mainController.addAmount( - userID, amount, year=date.year, month=date.month) + userID, amount, year=date.year, month=date.month, bar=True) user = mainController.getUser(userID) geruecht = user.getGeruecht(year=date.year) month = geruecht.getMonth(month=date.month) diff --git a/geruecht/controller/mainController/mainCreditListController.py b/geruecht/controller/mainController/mainCreditListController.py index 844206b..7e6f19f 100644 --- a/geruecht/controller/mainController/mainCreditListController.py +++ b/geruecht/controller/mainController/mainCreditListController.py @@ -29,7 +29,7 @@ class Base: user.updateData({'locked': False}) db.updateUser(user) - def addAmount(self, username, amount, year, month, finanzer=False): + def addAmount(self, username, amount, year, month, finanzer=False, bar=False): debug.info("add amount {{ {} }} to user {{ {} }} no month {{ {} }}, year {{ {} }}".format( amount, username, month, year)) user = self.getUser(username) @@ -41,8 +41,9 @@ class Base: debug.debug("user is not locked {{ {} }} or is finanzer execution {{ {} }}".format( user.locked, finanzer)) user.addAmount(amount, year=year, month=month) - user.last_seen = datetime.now() - db.updateLastSeen(user, user.last_seen) + if bar: + user.last_seen = datetime.now() + db.updateLastSeen(user, user.last_seen) creditLists = user.updateGeruecht() debug.debug("creditList is {{ {} }}".format(creditLists)) for creditList in creditLists: