diff --git a/app/parlamente.py b/app/parlamente.py index 9cbad29..907fe2f 100644 --- a/app/parlamente.py +++ b/app/parlamente.py @@ -772,15 +772,16 @@ class PortalaAdapter(ParlamentAdapter): results = self._parse_hit_list_html(report_resp.text, query_filter=query) # Server-side ETYPF/DTYPF filter is best-effort across portala # instances — BB/RP let "Kleine Anfrage" und "Beschluss- - # empfehlung" durch (siehe #61 Bug 2/3). Client-side strict - # filter on the parsed typ-string. Whitelist via Substring, - # damit "Antrag gemäß § 79 GO" und ähnliche Subtypen passieren. - if self.document_type: - target = self.document_type.lower() - results = [ - d for d in results - if target in (d.typ or "").lower() - ] + # empfehlung" durch, BE hat sogar `document_type=None` + # (eigene ETYPF-Werte), wodurch "Schriftliche Anfrage" das + # 200-Result-Window aushungern und Anträge wie 19/2650 nie + # zurückkommen. Wir filtern client-side IMMER auf + # "antrag"-Substring im typ — unabhängig davon, ob der + # Server-Filter gesetzt war (siehe #61 Bug 2, 3, 5). + results = [ + d for d in results + if "antrag" in (d.typ or "").lower() + ] return results[:limit] except Exception: