From 3065bba62145d1f2734c24490e8dcee0443368ce Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 3 Aug 2021 11:01:19 -0400 Subject: Add empty set as an initial value. Otherwise, the call to reduce will raise an error when no options for a given category are selected. --- pydis_site/apps/resources/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pydis_site/apps/resources/utils.py') diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py index 63d82b7a..bc2d4a70 100644 --- a/pydis_site/apps/resources/utils.py +++ b/pydis_site/apps/resources/utils.py @@ -47,7 +47,8 @@ def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Re ( reduce( or_, - (RESOURCE_TABLE[category][label] for label in labels) + (RESOURCE_TABLE[category][label] for label in labels), + set() ) for category, labels in search_categories.items() ) -- cgit v1.2.3