dont err if file doesnt delete

master
lza_menace 2 years ago
parent 1696c7fb58
commit f85f8cbdbf

@ -137,7 +137,10 @@ def delete(id):
if user == post.submitter or is_mod: if user == post.submitter or is_mod:
save_path_base = path.join(current_app.config["DATA_FOLDER"], "uploads") save_path_base = path.join(current_app.config["DATA_FOLDER"], "uploads")
save_path = path.join(save_path_base, post.image_name) 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}') audit_event(f'Deleted post {post.id}')
post.delete_instance() post.delete_instance()
flash("Deleted that shit, brah!", "is-success") flash("Deleted that shit, brah!", "is-success")

Loading…
Cancel
Save