Skip to content

Commit

Permalink
thesaurus topics should only return its own keys (GeoNode#11644)
Browse files Browse the repository at this point in the history
  • Loading branch information
giohappy authored Oct 30, 2023
1 parent ec457bc commit 6a8a202
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion geonode/facets/providers/thesaurus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions geonode/facets/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
Expand Down

0 comments on commit 6a8a202

Please sign in to comment.