diff --git a/geonode/facets/providers/thesaurus.py b/geonode/facets/providers/thesaurus.py index 047ac9b82ea..cec04f7ad16 100644 --- a/geonode/facets/providers/thesaurus.py +++ b/geonode/facets/providers/thesaurus.py @@ -111,7 +111,7 @@ def get_facet_items( def get_topics(self, keys: list, lang="en", **kwargs) -> list: q = ( - ThesaurusKeyword.objects.filter(id__in=keys) + ThesaurusKeyword.objects.filter(id__in=keys, thesaurus__identifier=self.name) .values("id", "alt_label") .annotate( localized_label=Subquery( diff --git a/geonode/facets/tests.py b/geonode/facets/tests.py index 8b4812a110f..22a9e18e929 100644 --- a/geonode/facets/tests.py +++ b/geonode/facets/tests.py @@ -498,6 +498,7 @@ def t(tk): {regfilter: "R0", t0filter: t("0_1"), "key": [t("1_1"), t("1_0")]}, {t("1_0"): None, t("1_1"): None}, ), + ("t_1", {"key": [t("0_1")]}, {}), # regions (regname, {t1filter: t("1_1")}, {"R1": 1}), (regname, {t1filter: t("1_1"), "key": ["R0", "R1"]}, {"R1": 1, "R0": None}),