Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
_get_di_results(): utilisation du dictionnaire de correspondances de …
Browse files Browse the repository at this point in the history
…thématiques
  • Loading branch information
ggounot committed Oct 1, 2024
1 parent 1d49725 commit eb949a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dora/services/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from dora import data_inclusion
from dora.admin_express.models import City
from dora.core.constants import WGS84
from dora.data_inclusion.constants import THEMATIQUES_MAPPING_DORA_TO_DI
from dora.structures.models import Structure

from .constants import EXCLUDED_DI_SERVICES_THEMATIQUES
Expand Down Expand Up @@ -124,7 +125,11 @@ def _get_di_results(
if categories is not None:
thematiques += categories
if subcategories is not None:
thematiques += [subcat for subcat in subcategories if "--autre" not in subcat]
for subcategory in subcategories:
if "--autre" not in subcategory:
thematiques += THEMATIQUES_MAPPING_DORA_TO_DI.get(
subcategory, [subcategory]
)

# Si on recherche uniquement des sous-catégories `autre`, la liste des thématiques va être vide et d·i renverrait
# *tous* les services. On renvoie donc plutôt une liste vide.
Expand Down

0 comments on commit eb949a8

Please sign in to comment.