From 0ec68b3d1be75d03cb282cf0ebdc3b99a5624341 Mon Sep 17 00:00:00 2001 From: Andrea Cecchi Date: Thu, 20 Mar 2025 17:26:12 +0100 Subject: [PATCH] Handle edge-case in @bandi-search-filters when a Bando does not have tipologia set. --- CHANGES.rst | 3 ++- src/design/plone/policy/restapi/bandi_search_filters/get.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index a7dfb64..e8e8356 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,8 @@ Changelog 4.0.12 (unreleased) ------------------- -- Nothing changed yet. +- Handle edge-case in @bandi-search-filters when a Bando does not have tipologia set. + [cekk] 4.0.11 (2024-09-05) diff --git a/src/design/plone/policy/restapi/bandi_search_filters/get.py b/src/design/plone/policy/restapi/bandi_search_filters/get.py index ebe735f..aa40405 100644 --- a/src/design/plone/policy/restapi/bandi_search_filters/get.py +++ b/src/design/plone/policy/restapi/bandi_search_filters/get.py @@ -32,6 +32,8 @@ def reply(self): for brain in brains: bando = brain.getObject() + if not bando.tipologia_bando: + continue found = [x for x in tipologie if x["UID"] == bando.tipologia_bando] if not found: tipologie.append(