From 4fccfab5f7420def08779c3e38d1b1d44e82617f Mon Sep 17 00:00:00 2001 From: borisLeBonPro Date: Thu, 19 Sep 2024 14:40:38 +0200 Subject: [PATCH] =?UTF-8?q?(PC-0000)[BO]=20fix:=20ceci=20est=20un=20test?= =?UTF-8?q?=20et=20cette=20PR=20sera=20bientot=20supprim=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/src/pcapi/core/offers/api.py | 2 ++ api/src/pcapi/models/feature.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/src/pcapi/core/offers/api.py b/api/src/pcapi/core/offers/api.py index 026cd427b0f..8d4d3b90f40 100644 --- a/api/src/pcapi/core/offers/api.py +++ b/api/src/pcapi/core/offers/api.py @@ -944,6 +944,8 @@ def _delete_stock(stock: models.Stock, author_id: int | None = None, user_connec transactional_mails.send_booking_cancellation_by_pro_to_beneficiary_email(booking) transactional_mails.send_booking_cancellation_confirmation_by_pro_email(cancelled_bookings) + if not FeatureToggle.WIP_DISABLE_NOTIFICATION_CANCEL_BOOKING.is_active(): + print("ceci est un test j'ajoute juste quelque chose pour voir") push_notification_job.send_cancel_booking_notification.delay([booking.id for booking in cancelled_bookings]) search.async_index_offer_ids( [stock.offerId], diff --git a/api/src/pcapi/models/feature.py b/api/src/pcapi/models/feature.py index c98694d5791..1d828f55639 100644 --- a/api/src/pcapi/models/feature.py +++ b/api/src/pcapi/models/feature.py @@ -123,6 +123,7 @@ class FeatureToggle(enum.Enum): WIP_ENABLE_NEW_COLLECTIVE_OFFERS_AND_BOOKINGS_STRUCTURE = ( "Activer la nouvelle structure des offres et réservations collectives" ) + WIP_DISABLE_NOTIFICATION_CANCEL_BOOKING = "test" def is_active(self) -> bool: if flask.has_request_context(): @@ -187,6 +188,7 @@ def nameKey(self) -> str: FeatureToggle.WIP_USE_OFFERER_ADDRESS_AS_DATA_SOURCE, FeatureToggle.WIP_SPLIT_OFFER, FeatureToggle.WIP_SUGGESTED_SUBCATEGORIES, + FeatureToggle.WIP_DISABLE_NOTIFICATION_CANCEL_BOOKING # Please keep alphabetic order )