From deeff1717b232d4af1279ae27c62976d7e974b01 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 9 Jan 2022 22:27:43 -0500 Subject: [PATCH] adding tempdir back --- app/classes/shared/helpers.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index e4b6d1b4..a24019c5 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -780,11 +780,9 @@ class Helpers: .format(os.path.join(folder, filename), os.path.join(folder, filename), os.path.join(folder, filename), os.path.join(folder, filename), filename, os.path.join(folder, filename), os.path.join(folder, filename), filename, filename) return output - def unzipServer(self, zip_path, user_id): - temp_uuid = str(uuid.uuid4()) + 'temp' - servers_path = str(self.get_servers_root_dir()) - tempDir = os.path.join(servers_path, temp_uuid) - os.mkdir(tempDir) + @staticmethod + def unzipServer(zip_path, user_id): + tempDir = tempfile.mkdtemp() with zipfile.ZipFile(zip_path, 'r') as zip_ref: #extracts archive to temp directory zip_ref.extractall(tempDir)