Suppression de workaround pour sqlite

This commit is contained in:
guimoz 2017-01-31 17:42:02 +01:00
parent 583475d1b6
commit af2e766e0a

View file

@ -202,22 +202,12 @@ def ban(player_id, target_id, success):
cur.execute("""select id,ban_end from players cur.execute("""select id,ban_end from players
where id=%i"""% banned_player['id']) where id=%i"""% banned_player['id'])
con.commit()
con.close()
con = connect_sql()
cur = con.cursor()
ban_end = cur.fetchone()[0] ban_end = cur.fetchone()[0]
ban_end = time() + BAN_DURATION ban_end = time() + BAN_DURATION
cur.execute("""update players set ban_end=%f cur.execute("""update players set ban_end=%f
where id=%i"""% [ban_end, banned_player['id']]) where id=%i"""% [ban_end, banned_player['id']])
con.commit()
con.close()
con = connect_sql()
cur = con.cursor()
cur.execute("""insert into bans (player_id,target_id,success,time) cur.execute("""insert into bans (player_id,target_id,success,time)
values %i,%i,%i,%f"""% [player['id'], target['id'], \ values %i,%i,%i,%f"""% [player['id'], target['id'], \
success and 1 or 0, time()]) success and 1 or 0, time()])