.BANCHO. Set ban_datetime when banning

This commit is contained in:
Nyo 2016-06-08 20:31:23 +02:00
parent e0d5348b48
commit b1e4314990
1 changed files with 2 additions and 1 deletions

View File

@ -286,7 +286,8 @@ def setAllowed(userID, allowed):
userID -- user
allowed -- allowed status. 1: normal, 0: banned
"""
glob.db.execute("UPDATE users SET allowed = %s WHERE id = %s", [allowed, userID])
banDateTime = int(time.time()) if allowed == 0 else 0
glob.db.execute("UPDATE users SET allowed = %s, ban_datetime = %s WHERE id = %s", [allowed, banDateTime, userID])
def setCountry(userID, country):
"""