From 46cb763d5b032b6ad2597e710d6c73b3b7442848 Mon Sep 17 00:00:00 2001 From: braisab Date: Thu, 21 Sep 2023 20:47:36 +0200 Subject: [PATCH] [IMP]pms_api_rest: if segmentationId equal to 0 it is deleted --- pms_api_rest/services/pms_reservation_service.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pms_api_rest/services/pms_reservation_service.py b/pms_api_rest/services/pms_reservation_service.py index 20ff02a7d..ccc767817 100644 --- a/pms_api_rest/services/pms_reservation_service.py +++ b/pms_api_rest/services/pms_reservation_service.py @@ -146,10 +146,13 @@ class PmsReservationService(Component): reservation_vals.update({"adults": reservation_data.adults}) if reservation_data.children is not None: reservation_vals.update({"children": reservation_data.children}) - if reservation_data.segmentationId: - reservation_vals.update( - {"segmentation_ids": [(6, 0, [reservation_data.segmentationId])]} - ) + if reservation_data.segmentationId is not None: + if reservation_data.segmentationId != 0: + reservation_vals.update( + {"segmentation_ids": [(6, 0, [reservation_data.segmentationId])]} + ) + else: + reservation_vals.update({"segmentation_ids": [(5, 0, 0)]}) if reservation_data.checkin: reservation_vals.update({"checkin": reservation_data.checkin}) if reservation_data.checkout: