Skip to content

Commit

Permalink
build file url
Browse files Browse the repository at this point in the history
  • Loading branch information
burnout87 committed Oct 17, 2024
1 parent f069dad commit ddbaadc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cdci_data_analysis/analysis/ivoa_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ def run_ivoa_query_from_product_gallery(parsed_query_obj,
if product_gallery_url is not None:
for index, value in enumerate(list_row):
description = cursor.description[index]
if description.name in {'file_uri', 'file_name'} and value is not None and isinstance(value, str):
file_name_list = [v.strip() for v in value.split(',')]
if description.name == 'file_uri':
for id, file_name in enumerate(file_name_list):
file_name_list[id] = os.path.join(product_gallery_url, 'sites/default/files/', file_name.strip())
list_row[index] = file_name_list
if description.name in {'path', 'path_alias'} and value is not None and isinstance(value, str):
if value.startswith('/'):
value = value[1:]
Expand Down

0 comments on commit ddbaadc

Please sign in to comment.