added URI encoding for single bund project requests
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit

This commit is contained in:
2026-06-21 22:48:51 +02:00
parent fa7e607f3e
commit 9f596e0e89
2 changed files with 7 additions and 4 deletions
@@ -3,7 +3,7 @@ import logging
from typing import Any, Dict, List, Optional, Set, Tuple
import httpx
import urllib
from inse.config import get_settings
from inse.models.bund_project import BundProject
from inse.projects.model import (
@@ -193,7 +193,7 @@ def _complete_response_to_bund_project_page(
def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]:
"""Fetches the details of a single Bund project based on its project ID.
"""Decodes project_id and fetches the details of a single Bund project based on its project ID.
Args:
project_id (str): The ID of the project to fetch.
@@ -201,7 +201,9 @@ def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]:
Returns:
Optional[BundProjectDetails]: The details of the project if found, otherwise None.
"""
query = {"term": {"Förderkennzeichen.keyword": {"value": project_id}}}
decoded_id = urllib.parse.unquote(project_id)
query = {"term": {"Förderkennzeichen.keyword": {"value": decoded_id}}}
response = elasticsearch.search(
index=ESIndex.PROJECTS_BUND_V1,
@@ -118,7 +118,8 @@ export class ProjectsComponent {
getDetaiLink(fundingProject: FundingProject): string | null {
if (fundingProject.type === 'bund') {
return '/projects/bund/' + fundingProject.id;
const encodedId = encodeURIComponent(fundingProject.id)
return '/projects/bund/' + encodedId;
} else if (fundingProject.type === 'dfg') {
return '/projects/dfg/' + fundingProject.id;
} else {