From 8ec3fd0687bf58d266243f0a4d8847c6d7f587d1 Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Tue, 21 Nov 2023 11:02:28 -0500 Subject: [PATCH] Fix constants reference --- src/schema/schema_manager.py | 4 ++-- src/schema/schema_triggers.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/schema/schema_manager.py b/src/schema/schema_manager.py index 1f0d79b5..cf247934 100644 --- a/src/schema/schema_manager.py +++ b/src/schema/schema_manager.py @@ -1211,7 +1211,7 @@ def get_user_info(request): def get_hubmap_ids(id): global _uuid_api_url - target_url = _uuid_api_url + schema_constants.UUID_API_ID_ENDPOINT + '/' + id + target_url = _uuid_api_url + SchemaConstants.UUID_API_ID_ENDPOINT + '/' + id # Use Memcached to improve performance response = make_request_get(target_url, internal_token_used = True) @@ -1373,7 +1373,7 @@ def create_hubmap_ids(normalized_class, json_data_dict, user_token, user_info_di logger.info(json_to_post) # Disable ssl certificate verification - target_url = _uuid_api_url + schema_constants.UUID_API_ID_ENDPOINT + target_url = _uuid_api_url + SchemaConstants.UUID_API_ID_ENDPOINT response = requests.post(url = target_url, headers = request_headers, json = json_to_post, verify = False, params = query_parms) # Invoke .raise_for_status(), an HTTPError will be raised with certain status codes diff --git a/src/schema/schema_triggers.py b/src/schema/schema_triggers.py index 5908fc05..182e5614 100644 --- a/src/schema/schema_triggers.py +++ b/src/schema/schema_triggers.py @@ -1194,7 +1194,7 @@ def commit_thumbnail_file(property_key, normalized_type, user_token, existing_da entity_uuid = existing_data_dict['uuid'] # Commit the thumbnail file via ingest-api call - ingest_api_target_url = schema_manager.get_ingest_api_url() + schema_constants.INGEST_API_FILE_COMMIT_ENDPOINT + ingest_api_target_url = schema_manager.get_ingest_api_url() + SchemaConstants.INGEST_API_FILE_COMMIT_ENDPOINT # Example: {"temp_file_id":"dzevgd6xjs4d5grmcp4n"} thumbnail_file_dict = new_data_dict[property_key] @@ -1296,7 +1296,7 @@ def delete_thumbnail_file(property_key, normalized_type, user_token, existing_da file_info_dict = generated_dict[target_property_key] # Remove the thumbnail file via ingest-api call - ingest_api_target_url = schema_manager.get_ingest_api_url() + schema_constants.INGEST_API_FILE_REMOVE_ENDPOINT + ingest_api_target_url = schema_manager.get_ingest_api_url() + SchemaConstants.INGEST_API_FILE_REMOVE_ENDPOINT # ingest-api's /file-remove takes a list of files to remove # In this case, we only need to remove the single thumbnail file @@ -1905,7 +1905,7 @@ def _commit_files(target_property_key, property_key, normalized_type, user_token entity_uuid = existing_data_dict['uuid'] # Commit the files via ingest-api call - ingest_api_target_url = schema_manager.get_ingest_api_url() + schema_constants.INGEST_API_FILE_COMMIT_ENDPOINT + ingest_api_target_url = schema_manager.get_ingest_api_url() + SchemaConstants.INGEST_API_FILE_COMMIT_ENDPOINT for file_info in new_data_dict[property_key]: temp_file_id = file_info['temp_file_id'] @@ -2015,7 +2015,7 @@ def _delete_files(target_property_key, property_key, normalized_type, user_token file_uuids.append(file_uuid) # Remove the files via ingest-api call - ingest_api_target_url = schema_manager.get_ingest_api_url() + schema_constants.INGEST_API_FILE_REMOVE_ENDPOINT + ingest_api_target_url = schema_manager.get_ingest_api_url() + SchemaConstants.INGEST_API_FILE_REMOVE_ENDPOINT json_to_post = { 'entity_uuid': entity_uuid,