Skip to content

Commit

Permalink
Merge pull request #141 from sennetconsortium/libpitt/138-uploads
Browse files Browse the repository at this point in the history
Update response to return obj expected by portal - #138
  • Loading branch information
maxsibilla authored Sep 18, 2023
2 parents 15799a2 + a713d15 commit e9928e6
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/routes/entity_CRUD/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1020,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
Expand Down Expand Up @@ -1057,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'])
Expand Down

0 comments on commit e9928e6

Please sign in to comment.