fix: Correctly convert single paragraph in FastAPI

This commit is contained in:
Adrian Rumpold
2025-05-20 09:14:47 +02:00
parent f0d4214d17
commit 56d271d0df

View File

@@ -160,9 +160,14 @@ def paragraph(
"""
xml = _get_fmx4_data(celex_id, language)
parag = extract_paragraph(xml, article_id=article_id, paragraph_id=parag_id)
if parag is None:
return Response(
"Paragraph not found",
status_code=404,
)
return Response(
FormexArticleConverter(language=language).convert_article(parag),
FormexArticleConverter(language=language)._convert_parag(parag),
media_type="text/html",
)