aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources/resource_search.py
diff options
context:
space:
mode:
authorGravatar swfarnsworth <[email protected]>2021-09-12 20:52:56 -0400
committerGravatar swfarnsworth <[email protected]>2021-09-12 20:52:56 -0400
commit4ad5846742674777268fa3a84908101953ed7ee1 (patch)
treeaf742cd715f6a48f09e1babe11fb3f30be62bf4e /pydis_site/apps/resources/resource_search.py
parentRemoved default selections. (diff)
Empty columns treated as all selected.
Treating an asterisk as a wild card is now redundant.
Diffstat (limited to 'pydis_site/apps/resources/resource_search.py')
-rw-r--r--pydis_site/apps/resources/resource_search.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pydis_site/apps/resources/resource_search.py b/pydis_site/apps/resources/resource_search.py
index 8454451a..1e23089b 100644
--- a/pydis_site/apps/resources/resource_search.py
+++ b/pydis_site/apps/resources/resource_search.py
@@ -40,6 +40,8 @@ RESOURCE_TABLE = MappingProxyType({
for category, d in _resource_table.items()
})
+ALL_RESOURCE_NAMES = frozenset(RESOURCES.keys())
+
def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]:
"""Returns a list of all resources that match the given search terms."""
@@ -50,7 +52,7 @@ def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Re
or_,
(RESOURCE_TABLE[category][label] for label in labels),
set()
- )
+ ) or ALL_RESOURCE_NAMES
for category, labels in search_categories.items()
)
)