From 4f64738f9ea9f880ca85ef9c2ff29e5d1e7654d0 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 14 Mar 2023 14:36:40 +0000 Subject: [PATCH] Update app.py --- application/app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/application/app.py b/application/app.py index 195ef4e7..36170d01 100644 --- a/application/app.py +++ b/application/app.py @@ -401,15 +401,13 @@ def delete_old(): import shutil path = request.args.get('path') dirs = path.split('/') - first_dir = path.split('/')[0] + dirs_clean = [] for i in range(1, len(dirs)): - dirs[i] = secure_filename(dirs[i]) - - + dirs_clean.append(secure_filename(dirs[i])) # check that path strats with indexes or vectors if dirs[0] not in ['indexes', 'vectors']: return {"status": 'error'} - path = '/'.join(dirs) + path_clean = '/'.join(dirs) shutil.rmtree(path) vectors_collection.delete_one({'location': path}) return {"status": 'ok'}