Include item titles in fetch response

This commit is contained in:
Tim Van Baak 2024-09-21 14:33:38 -07:00
parent 92a10c5ca8
commit 4abb281715
1 changed files with 5 additions and 1 deletions

View File

@ -16,6 +16,7 @@ from flask import (
redirect, redirect,
url_for, url_for,
current_app, current_app,
make_response,
) )
from intake.core import intake_data_dir from intake.core import intake_data_dir
@ -396,8 +397,11 @@ def fetch(source_name: str):
try: try:
items = fetch_items(source) items = fetch_items(source)
titles = "\n".join(item.display_title for item in items)
update_items(source, items) update_items(source, items)
return f"Update returned {len(items)} items" response = make_response(f"Update returned {len(items)} items:\n{titles}", 200)
response.mimetype = "text/plain"
return response
except InvalidConfigException as ex: except InvalidConfigException as ex:
abort(500, f"Could not fetch {source_name}:\n{ex}") abort(500, f"Could not fetch {source_name}:\n{ex}")
except SourceUpdateException as ex: except SourceUpdateException as ex: