From fffd86b8c224754526657311616ee5db5aae388a Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Mon, 2 Oct 2023 15:25:18 -0400 Subject: [PATCH] Updating files_exist method to correct in data ingest board --- src/lib/file.py | 7 +++---- src/routes/entity_CRUD/__init__.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/file.py b/src/lib/file.py index a8e703b4..93803a2c 100644 --- a/src/lib/file.py +++ b/src/lib/file.py @@ -83,18 +83,17 @@ def ln_err(error: str, row: int = None, column: str = None): } -def files_exist(uuid, data_access_level): +def files_exist(uuid, data_access_level, group_name): if not uuid or not data_access_level: return False if data_access_level == "public": absolute_path = commons_file_helper.ensureTrailingSlashURL(current_app.config['GLOBUS_PUBLIC_ENDPOINT_FILEPATH']) # consortium access elif data_access_level == 'consortium': - absolute_path = commons_file_helper.ensureTrailingSlashURL(current_app.config['GLOBUS_CONSORTIUM_ENDPOINT_FILEPATH']) + absolute_path = commons_file_helper.ensureTrailingSlashURL(current_app.config['GLOBUS_CONSORTIUM_ENDPOINT_FILEPATH'] + '/' + group_name) # protected access elif data_access_level == 'protected': - absolute_path = commons_file_helper.ensureTrailingSlashURL(current_app.config['GLOBUS_PROTECTED_ENDPOINT_FILEPATH']) - + absolute_path = commons_file_helper.ensureTrailingSlashURL(current_app.config['GLOBUS_PROTECTED_ENDPOINT_FILEPATH'] + '/' + group_name) file_path = absolute_path + uuid if os.path.exists(file_path) and os.path.isdir(file_path) and os.listdir(file_path): return True diff --git a/src/routes/entity_CRUD/__init__.py b/src/routes/entity_CRUD/__init__.py index daac6629..873a8fd2 100644 --- a/src/routes/entity_CRUD/__init__.py +++ b/src/routes/entity_CRUD/__init__.py @@ -639,7 +639,7 @@ def dataset_data_status(): dataset['is_primary'] = "true" else: dataset['is_primary'] = "false" - has_data = files_exist(dataset.get('uuid'), dataset.get('data_access_level')) + has_data = files_exist(dataset.get('uuid'), dataset.get('data_access_level'), dataset.get('group_name')) dataset['has_data'] = has_data for prop in dataset: