mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Reminders work
This commit is contained in:
parent
6682327f1e
commit
95bdc576e1
4 changed files with 17 additions and 10 deletions
|
|
@ -17,7 +17,7 @@ def getOrAddUser(userid):
|
|||
res = cursor.fetchall()
|
||||
|
||||
if not res:
|
||||
cursor.execute("INSERT INTO remind(userid) VALUES %s", (int(userid),))
|
||||
cursor.execute("INSERT INTO remind(userid) VALUES(%s)", (int(userid),))
|
||||
connection.commit()
|
||||
|
||||
return getOrAddUser(userid)
|
||||
|
|
@ -36,7 +36,7 @@ def switchReminder(userid, column):
|
|||
# Switch the column value
|
||||
to = not (res[columns.index(column)])
|
||||
|
||||
cursor.execute("UPDATE remind SET %s = %s WHERE userid = %s", (column, to, int(userid),))
|
||||
cursor.execute("UPDATE remind SET {} = %s WHERE userid = %s".format(column), (to, int(userid),))
|
||||
connection.commit()
|
||||
|
||||
return to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue