Skip to content

Commit

Permalink
update bookable_list
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-bellenghi committed May 15, 2024
1 parent f19c7ab commit 7ef2dd0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@


class BookableList(Service):

SERVIZIO_CONTENT_TYPE = "Servizio"

def reply(self):
"""
Return all UO with at least one back-refence from PrenotazioniFolder
Expand All @@ -30,7 +33,7 @@ def reply(self):
"items": [],
}
portal_url = api.portal.get().absolute_url()
query = {"portal_type": "Servizio", "sort_on": "sortable_title"}
query = {"portal_type": self.SERVIZIO_CONTENT_TYPE, "sort_on": "sortable_title"}
for brain_service in api.content.find(**query):
# XXX: get_uo_from_service_uid ha l'object, ma anzichè usarlo, si tira fuori lo UID
# e poi si cerca quell'UID nel catalog. Sicuarmente questo aiuta a escludere
Expand Down Expand Up @@ -94,7 +97,7 @@ def get_uo_from_service_uid(self, uid):
service = api.content.get(UID=uid)
if not service:
return []
if service.portal_type != "Servizio":
if service.portal_type != self.SERVIZIO_CONTENT_TYPE:
return []
canale_fisico = getattr(service, "canale_fisico", [])
if canale_fisico:
Expand Down

0 comments on commit 7ef2dd0

Please sign in to comment.