Commit 11e1dc04 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Deleting old temp users bulk

parent c66bf51e
......@@ -183,11 +183,14 @@ def cleanup():
application.config['PRIVILEGEDBPORT']))
raise e
logging.debug("Deleting from privileges database")
users_to_delete = ""
for uidx in users:
logging.debug(uidx)
cur.execute("""
delete from eida_temp_users where name=%s;
""", [uidx[1]])
users_to_delete.append("'%s',",uidx[1])
cur.execute("""
delete from eida_temp_users where name in (%s);
""", users_to_delete[:-1])
conn.commit()
conn.close()
return Response("Deleted %d temporary accounts."%(len(users)), status=200)
......
__version__='0.2.1'
__version__='0.2.2'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment