From 6ecdf91ee0bd7b8f51049f5e2ba6091415e4612a Mon Sep 17 00:00:00 2001 From: Lisa-Ann B Date: Wed, 13 Sep 2023 15:54:49 -0400 Subject: [PATCH 1/2] Update response to return obj expected by portal - #138 --- src/routes/entity_CRUD/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/entity_CRUD/__init__.py b/src/routes/entity_CRUD/__init__.py index 960e92cb..20377157 100644 --- a/src/routes/entity_CRUD/__init__.py +++ b/src/routes/entity_CRUD/__init__.py @@ -972,8 +972,6 @@ def submit_upload(upload_uuid): update_url = commons_file_helper.ensureTrailingSlashURL(current_app.config['ENTITY_WEBSERVICE_URL']) + 'entities/' + upload_uuid # Disable ssl certificate verification resp = requests.put(update_url, headers=http_headers, json=upload_changes, verify = False) - if resp.status_code >= 300: - return Response(resp.text, resp.status_code) #disable validations stuff for now... ##call the AirFlow validation workflow @@ -983,7 +981,7 @@ def submit_upload(upload_uuid): #if resp.status_code >= 300: # return Response(resp.text, resp.status_code) - return(Response("Upload updated successfully", 200)) + return Response(resp.text, resp.status_code) #method to validate an Upload #saves the upload then calls the validate workflow via From a713d153f987e551931cb067945ce451e6a0c36a Mon Sep 17 00:00:00 2001 From: Lisa-Ann B Date: Mon, 18 Sep 2023 13:48:52 -0400 Subject: [PATCH 2/2] Update response type to correspond with ui's expected end - #138 --- src/routes/entity_CRUD/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/entity_CRUD/__init__.py b/src/routes/entity_CRUD/__init__.py index 20377157..14a50448 100644 --- a/src/routes/entity_CRUD/__init__.py +++ b/src/routes/entity_CRUD/__init__.py @@ -1018,11 +1018,11 @@ def validate_upload(upload_uuid): ##call the AirFlow validation workflow validate_url = commons_file_helper.ensureTrailingSlashURL(current_app.config['INGEST_PIPELINE_URL']) + 'uploads/' + upload_uuid + "/validate" ## Disable ssl certificate verification - resp = requests.put(validate_url, headers=http_headers, json=upload_changes, verify = False) - if resp.status_code >= 300: - return Response(resp.text, resp.status_code) + resp2 = requests.put(validate_url, headers=http_headers, json=upload_changes, verify = False) + if resp2.status_code >= 300: + return Response(resp2.text, resp2.status_code) - return(Response("Upload updated successfully", 200)) + return Response(resp.text, resp.status_code) #method to reorganize an Upload #saves the upload then calls the reorganize workflow via @@ -1055,11 +1055,11 @@ def reorganize_upload(upload_uuid): ##call the AirFlow validation workflow validate_url = commons_file_helper.ensureTrailingSlashURL(current_app.config['INGEST_PIPELINE_URL']) + 'uploads/' + upload_uuid + "/reorganize" ## Disable ssl certificate verification - resp = requests.put(validate_url, headers=http_headers, json=upload_changes, verify = False) - if resp.status_code >= 300: - return Response(resp.text, resp.status_code) + resp2 = requests.put(validate_url, headers=http_headers, json=upload_changes, verify = False) + if resp2.status_code >= 300: + return Response(resp2.text, resp2.status_code) - return(Response("Upload reorganize started successfully", 200)) + return Response(resp.text, resp.status_code) @entity_CRUD_blueprint.route('/uploads/data-status', methods=['GET'])