From f85f8cbdbf039d3fead66952eb0e8e9f7d2fccce Mon Sep 17 00:00:00 2001 From: lza_menace Date: Wed, 31 Aug 2022 23:48:18 -0700 Subject: [PATCH] dont err if file doesnt delete --- suchwow/routes/post.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/suchwow/routes/post.py b/suchwow/routes/post.py index 11acec5..0ada6d3 100644 --- a/suchwow/routes/post.py +++ b/suchwow/routes/post.py @@ -137,7 +137,10 @@ def delete(id): if user == post.submitter or is_mod: save_path_base = path.join(current_app.config["DATA_FOLDER"], "uploads") save_path = path.join(save_path_base, post.image_name) - remove(save_path) + try: + remove(save_path) + except: + pass audit_event(f'Deleted post {post.id}') post.delete_instance() flash("Deleted that shit, brah!", "is-success")