Skip to content

Commit

Permalink
Merge pull request #559 from oda-hub/bug-returned-obs-attachment-content
Browse files Browse the repository at this point in the history
Check list has at least one element
  • Loading branch information
burnout87 authored Jul 26, 2023
2 parents 7d50f36 + 3836d7e commit 263de6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cdci_data_analysis/analysis/drupal_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def get_all_revolutions(product_gallery_url, gallery_jwt_token, sentry_dsn=None)
headers=headers,
sentry_dsn=sentry_dsn)
output_get = analyze_drupal_output(log_res, operation_performed="retrieving all the revolutions from the product gallery")
if isinstance(output_get, list):
if isinstance(output_get, list) and len(output_get) >= 1:
entities = list(obj['title'] for obj in output_get)

return entities
Expand Down Expand Up @@ -971,7 +971,7 @@ def get_observation_yaml_attachments_by_observation_title(product_gallery_url, g
sentry_dsn=sentry_dsn)
output_get = analyze_drupal_output(log_res, operation_performed="retrieving the observation attachments")

if output_get is not None and isinstance(output_get, list):
if output_get is not None and isinstance(output_get, list) and len(output_get) >= 1:
# TODO might be needed if a better formatting of the output is needed
# if 'file_content' in output_get[0]:
# splitted_content_list = output_get[0]['file_content'].split('{"single_file_content": "')
Expand Down

0 comments on commit 263de6e

Please sign in to comment.