From bfbdb50e5fe6e87c14514183800bccb29de8762e Mon Sep 17 00:00:00 2001 From: Irwan Fathurrahman Date: Wed, 12 Jun 2024 13:22:12 +0700 Subject: [PATCH] Add measurement folder settings --- models/well.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/models/well.py b/models/well.py index cb5ee14..b6fda78 100644 --- a/models/well.py +++ b/models/well.py @@ -215,8 +215,9 @@ def return_measurement_cache_path(self, measurement_name: str): """ Return file path of cache file """ - folder = os.path.join(settings.MEDIA_ROOT, 'measurement-cache', - '{}'.format(self.id)) + folder = os.path.join( + settings.MEASUREMENTS_FOLDER, '{}'.format(self.id) + ) return os.path.join(folder, '{}.gz'.format(measurement_name)) def measurement_data(self, measurement_name: str): @@ -282,7 +283,7 @@ def measurement_data(self, measurement_name: str): def generate_measurement_cache(self, model=None): """ Generate measurement cache """ folder = os.path.join( - settings.MEDIA_ROOT, 'measurement-cache', '{}'.format(self.id) + settings.MEASUREMENTS_FOLDER, '{}'.format(self.id) ) if not os.path.exists(folder): os.makedirs(folder)