Commit f62ed588 authored by Merret Buurman's avatar Merret Buurman
Browse files

Catch error if parent handle record cannot be retrieved.

parent 232d4961
......@@ -221,10 +221,21 @@ def _get_list_of_aggregation_records_from_record(list_of_aggregation_handles):
any_replaced = False
for handle in list_of_aggregation_handles:
info, replaced = _extract_info_on_one_aggregation_record(handle)
list_to_be_returned.append(info)
if replaced:
any_replaced = True
try:
info, replaced = _extract_info_on_one_aggregation_record(handle)
list_to_be_returned.append(info)
if replaced:
any_replaced = True
except ValueError:
# If we cannot access the parent record, do not
# append anything, just leave this one out.
pass
# If no parent handle record could be retrieved, but there is parents,
# return None to show that something went wrong.
if len(list_to_be_returned) == 0 and len(list_of_aggregation_handles) > 0:
list_to_be_returned = None
any_replaced = None
return list_to_be_returned, any_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