From e6ebeb406dfdd57081792f0b35eb6a3cb8ff099b Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 28 Feb 2024 17:24:31 +1100 Subject: [PATCH] fix: Images deleting when saving --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 09143fa..d716fcb 100644 --- a/main.py +++ b/main.py @@ -177,6 +177,8 @@ def site_post(): data['fg_0'] = request.form['fg_0'] data['btn_bg'] = request.form['btn_bg'] data['btn_fg'] = request.form['btn_fg'] + if 'image' not in data: + data['image'] = '' socials = [] socials.append({'name': 'email', 'url': request.form['email']}) @@ -204,7 +206,6 @@ def site_post(): address = [i for i in address if i['address'] != ''] data['address'] = address - data['image'] = '' if 'image' in request.files: if request.files['image'].filename != '' and request.files['image'].filename != None: # Make sure the file is an image