From 4ed8f7974d3e2ae6734b95122a79e181d6c65fa9 Mon Sep 17 00:00:00 2001 From: Stephen Bananarama Date: Mon, 20 Sep 2021 10:49:01 -0700 Subject: [PATCH] Fix url mismatch by replacing uri hack with correct value which is supplied by the API --- .../implementations/coveo_implementation.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/panoptoindexconnector/implementations/coveo_implementation.py b/src/panoptoindexconnector/implementations/coveo_implementation.py index e1da1d3..ab8566e 100644 --- a/src/panoptoindexconnector/implementations/coveo_implementation.py +++ b/src/panoptoindexconnector/implementations/coveo_implementation.py @@ -126,7 +126,7 @@ def push_content_data(target_content, config): field_mapping = config.field_mapping url = '{coveourl}/push/v1/organizations/{org}/sources/{source}/documents?documentId=%s' % ( - _get_document_id(config.panopto_site_address, target_content[field_mapping['Id']])) + target_content[field_mapping['Url']]) _ = _send_coveo_request(config, url, 'put', json=target_content) @@ -171,7 +171,7 @@ def delete_from_target(video_id, config): """ url = '{coveourl}/push/v1/organizations/{org}/sources/{source}/documents?documentId=' + \ - _get_document_id(config.panopto_site_address, video_id) + target_content[field_mapping['Url']] _ = _send_coveo_request(config, url, 'delete') @@ -254,14 +254,6 @@ def should_map_security(key): return key not in SECURITY_IDS_MAPPED_TO_PROVIDER -def _get_document_id(panopto_site_address, vid): - """ - Coveo document id must be formatted as a uri - """ - return '{site}/Panopto/Pages/Viewer.aspx?id={id}'.format( - site=panopto_site_address, id=vid) - - def _get_default_headers(api_key): """ Gets the common headers