# Try to remove old relation of identifier
# As 'delete or ignore' does not exist, workaround is used
- res = c.execute("select * from identifiers where id = ? and active = ?", (iid, 0, ))
+ res = c.execute("select * from identifiers where id = ? and active = 0", (iid, ))
# This is True when some rows were found before; delete old relation
if res.fetchone():
- res = c.execute("delete from identifiers where id = ? and active = ?", (iid, 0, ))
+ print("Deleting uid:%s id:%s" % (uid, iid))
+ res = c.execute("delete from identifiers where id = ? and active = 0", (iid, ))
# Add new relation
res = c.execute("insert into identifiers (userid, id, name) values (?, ?, ?)", (uid, iid, name, ))
def disable_user_identifier(uid, iid):
conn, c = open_db()
- c.execute("update identifiers set active = ? where userid = ? and id = ?", (0, uid, iid, ))
+ c.execute("update identifiers set active = 0 where userid = ? and id = ?", (uid, iid, ))
close_db(conn)
def get_name(uid):