fixed bug, dass auch der finanzer schulden hinzufügen kann ohne dass last_seen aktualisiert wird

This commit is contained in:
Tim Gröger 2020-06-08 00:03:27 +02:00
parent f4ab34c298
commit c7e1c981e6
2 changed files with 5 additions and 4 deletions

View File

@ -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)

View File

@ -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: