Commit 18963ff9 authored by Merret Buurman's avatar Merret Buurman
Browse files

Return 'unknown' if handle records of children/parents are not accessible.

parent 636cbcc0
......@@ -230,6 +230,16 @@ def _get_list_of_aggregation_records_from_record(list_of_aggregation_handles):
return list_to_be_returned, any_replaced
def _extract_info_on_one_aggregation_record(parenthandle):
#
info_to_return = dict(
handle = parenthandle,
level = '',
title = '(title unknown)',
version = 'unknown',
replaced = False
)
replaced = False # We don't know, but need to put something here...
# Retrieve handle:
try:
......@@ -253,14 +263,7 @@ def _extract_info_on_one_aggregation_record(parenthandle):
replaced = newer_version
)
except ValueError:
info_to_return = dict(
handle = parenthandle,
level = 'unknown',
title = 'title unknown',
version = 'unknown',
replaced = 'unknown'
)
replaced = False # We don't know, but need to put somethine here...
pass
return info_to_return, replaced
###
......@@ -323,6 +326,15 @@ def _get_list_of_parts_records_from_record(record):
def _extract_info_on_one_part_record(handle):
# Create variables to be filled by data retrieved from handle
info_to_return = dict(
handle = handle,
level = 'unknown',
title = '(title unknown)',
replaced = False
)
replaced = False
# Retrieve handle:
try:
record = retrieval.get_handle_record_json(handle)
......@@ -332,7 +344,6 @@ def _extract_info_on_one_part_record(handle):
title = get_title_from_record(record)
vers_num = get_version_number_from_record(record)
newer_version = get_replaced_by_from_record(record)
replaced = False
if newer_version is not None and not newer_version == handle:
replaced = True
......@@ -347,12 +358,8 @@ def _extract_info_on_one_part_record(handle):
info_to_return['version'] = vers_num
except ValueError:
info_to_return = dict(
handle = handle,
level = 'unknown',
title = 'title unknown',
replaced = False
)
pass
return info_to_return, replaced
......
Markdown is supported
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