dont delete the original image if process_image fails

master
Aevann 2024-04-11 13:51:31 +02:00
parent 25bd39adbb
commit b2dede21b1
1 changed files with 2 additions and 1 deletions

View File

@ -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)