From 8cc972a0f4885b7ac19e6c405c645c2e1cdb0ff8 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Wed, 31 Jul 2024 18:21:56 +0200 Subject: [PATCH] notify_on_confirm --- src/design/plone/ioprenoto/restapi/services/booking/get.py | 5 +++++ src/design/plone/ioprenoto/tests/test_booking_info.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/design/plone/ioprenoto/restapi/services/booking/get.py b/src/design/plone/ioprenoto/restapi/services/booking/get.py index cd547bd..72d8bb0 100644 --- a/src/design/plone/ioprenoto/restapi/services/booking/get.py +++ b/src/design/plone/ioprenoto/restapi/services/booking/get.py @@ -49,4 +49,9 @@ def reply(self): (booking, self.request), ISerializeToPrenotazioneSearchableItem )(fullobjects=True) + # BBB: + if "notify_on_confirm" not in response: + prenotazioni_folder = booking.getPrenotazioniFolder() + response["notify_on_confirm"] = prenotazioni_folder.notify_on_confirm + return response diff --git a/src/design/plone/ioprenoto/tests/test_booking_info.py b/src/design/plone/ioprenoto/tests/test_booking_info.py index 43c5e09..6725816 100644 --- a/src/design/plone/ioprenoto/tests/test_booking_info.py +++ b/src/design/plone/ioprenoto/tests/test_booking_info.py @@ -224,3 +224,7 @@ def test_get_bookings(self): booking_info["booking_office"]["@id"], self.unita_organizzativa.absolute_url(), ) + self.assertEqual( + booking_info["notify_on_confirm"], + False, + )