Unverified Commit 0820fa20 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

fix reporting for unenrichable records

Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 6bf86c4f
Pipeline #17934 passed with stages
in 1 minute and 54 seconds
...@@ -281,8 +281,8 @@ class MediametadataToDB: ...@@ -281,8 +281,8 @@ class MediametadataToDB:
logging.debug(f'Processing record {record_id}') logging.debug(f'Processing record {record_id}')
access_status = _get_access_status(record, record_id) access_status = _get_access_status(record, record_id)
if access_status == 'public' or access_status == 'closed': if access_status == 'public' or access_status == 'closed':
enrichable = False
for record_resource in record: for record_resource in record:
enrichable = False
if 'type' in record_resource and \ if 'type' in record_resource and \
record_resource['type'] == 'digitalObject' and \ record_resource['type'] == 'digitalObject' and \
_has_http_locator(record_resource): _has_http_locator(record_resource):
...@@ -310,10 +310,10 @@ class MediametadataToDB: ...@@ -310,10 +310,10 @@ class MediametadataToDB:
"Could not process thumbnail object") "Could not process thumbnail object")
else: else:
record_values_for_db.append(enriched_data) record_values_for_db.append(enriched_data)
if not enrichable: if not enrichable:
reporter.send_message(record_id, reporter.send_message(record_id,
"Resource has no digitalObject or thumbnail") "Resource has no digitalObject or thumbnail")
else: else:
logging.info(f'Ignoring record {record_id} since' + logging.info(f'Ignoring record {record_id} since' +
f' access of digitalObject is {access_status}') f' access of digitalObject is {access_status}')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment