diff --git a/changes/unreleased.md b/changes/unreleased.md index 3ec8407e..bf53089c 100644 --- a/changes/unreleased.md +++ b/changes/unreleased.md @@ -1,2 +1,3 @@ - ff-158 — Improved prompts to produce less tags of better quality. +- ff-159 — Fixed the exception in the API when no entries found. diff --git a/ffun/ffun/api/http_handlers.py b/ffun/ffun/api/http_handlers.py index 63c82160..d04b5d2e 100644 --- a/ffun/ffun/api/http_handlers.py +++ b/ffun/ffun/api/http_handlers.py @@ -73,7 +73,10 @@ async def _external_entries( # pylint: disable=R0914 tags_ids = await o_domain.get_tags_ids_for_entries(entries_ids) - whole_tags = set.union(*tags_ids.values()) + if tags_ids: + whole_tags = set.union(*tags_ids.values()) + else: + whole_tags = set() tags_mapping = await o_domain.get_tags_by_ids(whole_tags)