mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Move Crafty server upload to /import/upload
This commit is contained in:
parent
2f65971261
commit
0296b09547
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,6 +18,7 @@ env.bak/
|
||||
venv.bak/
|
||||
|
||||
.idea/
|
||||
/import/
|
||||
/imports/
|
||||
/servers/
|
||||
/app/frontend/static/assets/images/auth/custom/
|
||||
|
@ -757,11 +757,13 @@ class TasksManager:
|
||||
)
|
||||
# Search for old files in imports
|
||||
self.helper.ensure_dir_exists(
|
||||
os.path.join(self.controller.project_root, "imports")
|
||||
os.path.join(self.controller.project_root, "import", "upload")
|
||||
)
|
||||
for file in os.listdir(os.path.join(self.controller.project_root, "imports")):
|
||||
for file in os.listdir(
|
||||
os.path.join(self.controller.project_root, "import", "upload")
|
||||
):
|
||||
if self.helper.is_file_older_than_x_days(
|
||||
os.path.join(self.controller.project_root, "imports", file)
|
||||
os.path.join(self.controller.project_root, "import", file)
|
||||
):
|
||||
try:
|
||||
os.remove(os.path.join(file))
|
||||
|
@ -64,7 +64,9 @@ class ApiImportFilesIndexHandler(BaseApiHandler):
|
||||
# JSON we need to remove this and just send
|
||||
# the path.
|
||||
if data["upload"]:
|
||||
folder = os.path.join(self.controller.project_root, "imports", folder)
|
||||
folder = os.path.join(
|
||||
self.controller.project_root, "import", "upload", folder
|
||||
)
|
||||
if Helpers.check_file_exists(folder):
|
||||
folder = self.file_helper.unzip_server(folder, user_id)
|
||||
root_path = True
|
||||
|
@ -102,7 +102,8 @@ class UploadHandler(BaseHandler):
|
||||
)
|
||||
self.do_upload = False
|
||||
|
||||
path = os.path.join(self.controller.project_root, "imports")
|
||||
path = os.path.join(self.controller.project_root, "import", "upload")
|
||||
self.helper.ensure_dir_exists(path)
|
||||
# Delete existing files
|
||||
if len(os.listdir(path)) > 0:
|
||||
for item in os.listdir():
|
||||
|
Loading…
Reference in New Issue
Block a user