Skip to content

Commit

Permalink
(PC-0000)[BO] fix: ceci est un test et cette PR sera bientot supprimé
Browse files Browse the repository at this point in the history
  • Loading branch information
borisLeBonPro committed Sep 19, 2024
1 parent b4bbbdc commit 34c7f7b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/src/pcapi/core/bookings/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ def cancel_booking_by_beneficiary(user: User, booking: Booking) -> None:
def cancel_booking_by_offerer(booking: Booking) -> None:
validation.check_booking_can_be_cancelled(booking)
_cancel_booking(booking, BookingCancellationReasons.OFFERER, raise_if_error=True)
push_notification_job.send_cancel_booking_notification.delay([booking.id])
if not FeatureToggle.WIP_DISABLE_NOTIFICATION_CANCEL_BOOKING.is_active():
push_notification_job.send_cancel_booking_notification.delay([booking.id])
user_emails_job.send_booking_cancellation_emails_to_user_and_offerer_job.delay(booking.id)


Expand Down
3 changes: 2 additions & 1 deletion api/src/pcapi/core/offers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +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)

push_notification_job.send_cancel_booking_notification.delay([booking.id for booking in cancelled_bookings])
if not FeatureToggle.WIP_DISABLE_NOTIFICATION_CANCEL_BOOKING.is_active():
push_notification_job.send_cancel_booking_notification.delay([booking.id for booking in cancelled_bookings])
search.async_index_offer_ids(
[stock.offerId],
reason=search.IndexationReason.STOCK_DELETION,
Expand Down
2 changes: 2 additions & 0 deletions api/src/pcapi/models/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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
)

Expand Down

0 comments on commit 34c7f7b

Please sign in to comment.