Ensure image files & Record can be cleaned when a user is removed

This commit is contained in:
XD-DENG
2017-07-08 11:39:59 +08:00
parent 4b693ddb69
commit 961f17c2f5
6 changed files with 10 additions and 1 deletions

View File

@@ -42,7 +42,9 @@ def delete_user_from_db(id):
_conn.commit()
_conn.close()
# when we delete a user from database USERS, we also need to delete all his or her images data from database IMAGES
# when we delete a user from database USERS, we also need to
# [1] delete all his or her images from image pool (done in app.py)
# [2] delete all his or her images records from database IMAGES
_conn = sqlite3.connect(image_db_file_location)
_c = _conn.cursor()
_c.execute("delete from images where owner = '" + id + "';")