Appeasing pylance.
This commit is contained in:
parent
9d0dad8d74
commit
2fd607a61a
1 changed files with 4 additions and 1 deletions
|
@ -79,7 +79,10 @@ def delete_image(image_id):
|
|||
if not image:
|
||||
return jsonify({"success": False, "error": "Image not found"})
|
||||
|
||||
abs_path = os.path.join(current_app.static_folder, image.filename.replace("\\", "/"))
|
||||
rel_path = posixpath.normpath(str(image.filename))
|
||||
static_dir = str(current_app.static_folder) # appease the gods
|
||||
abs_path = os.path.join(static_dir, rel_path)
|
||||
|
||||
if os.path.exists(abs_path):
|
||||
os.remove(abs_path)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue