From b2dede21b126a7773b3fdfaa288f776409b79962 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 11 Apr 2024 13:51:31 +0200 Subject: [PATCH] dont delete the original image if process_image fails --- files/routes/art_submissions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/art_submissions.py b/files/routes/art_submissions.py index 2ea11286e..4d8cea2cc 100644 --- a/files/routes/art_submissions.py +++ b/files/routes/art_submissions.py @@ -123,9 +123,10 @@ def approve_art(v, id): else: filename = f"files/assets/images/{SITE_NAME}/{entry.location_kind}/{entry.id}.webp" - move(old, filename) + copyfile(old, filename) trim = (entry.kind == 'sidebar') process_image(filename, v, resize=entry.resize, trim=trim) + os.remove(old) author = request.values.get('author').strip() author = get_user(author)