From 70fb7198255bddc0dcd2f671c0ec8c915e993702 Mon Sep 17 00:00:00 2001 From: Ross Mountjoy Date: Sat, 1 Feb 2020 18:22:47 -0500 Subject: [PATCH] replaced os.rename with shutil.move --- dashmachine/settings_system/routes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dashmachine/settings_system/routes.py b/dashmachine/settings_system/routes.py index 1b60560..a6c5719 100644 --- a/dashmachine/settings_system/routes.py +++ b/dashmachine/settings_system/routes.py @@ -1,4 +1,5 @@ import os +from shutil import move from flask import render_template, request, Blueprint, jsonify from dashmachine.settings_system.forms import ConfigForm from dashmachine.user_system.forms import UserForm @@ -51,7 +52,7 @@ def add_images(): for cached_file in request.form.get("files").split(","): file = Files.query.filter_by(cache=cached_file).first() new_path = os.path.join(dest_folder, file.name) - os.rename(file.path, new_path) + move(file.path, new_path) return load_files_html()