From 91e33a1768e8e66b968fd3df39a4e7e022a4c0a5 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Thu, 23 Jan 2020 12:17:58 -0500 Subject: [PATCH] Deletes associated file_data records when deleting a file. --- crc/api/file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crc/api/file.py b/crc/api/file.py index 12bbf42b..85b70f82 100644 --- a/crc/api/file.py +++ b/crc/api/file.py @@ -88,5 +88,6 @@ def get_file_info(file_id): def delete_file(file_id): - session.query(FileDataModel).filter_by(id=file_id).delete() + session.query(FileDataModel).filter_by(file_model_id=file_id).delete() session.query(FileModel).filter_by(id=file_id).delete() + session.commit()