From 8499d71c92bd3ab8ee44021fbc830f00cb4bbe2f Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 26 Oct 2023 15:10:41 +0200 Subject: [PATCH] Refactor --- .../prenotazioni/content/prenotazioni_folder.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/redturtle/prenotazioni/content/prenotazioni_folder.py b/src/redturtle/prenotazioni/content/prenotazioni_folder.py index 9756287e..b9fddc79 100644 --- a/src/redturtle/prenotazioni/content/prenotazioni_folder.py +++ b/src/redturtle/prenotazioni/content/prenotazioni_folder.py @@ -3,7 +3,6 @@ from collective.z3cform.datagridfield.datagridfield import DataGridFieldFactory from collective.z3cform.datagridfield.row import DictRow -from plone import api from plone.app.textfield import RichText from plone.autoform import directives from plone.autoform import directives as form @@ -736,11 +735,4 @@ def getCosaServe(self): return self.cosa_serve def get_booking_types(self) -> Generator[BookingType, None, None]: - for booking_type in api.content.find( - portal_type="BookingType", - path={ - "query": "/".join(self.getPhysicalPath()), - "depth": 1, - }, - ): - yield booking_type.getObject() + return self.listFolderContents(contentFilter={"portal_type": "BookingType"})