From a3a3902d213204e32b3595b48b2ef376f44fe1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Sun, 11 Jun 2023 09:55:50 +0200 Subject: [PATCH] [TMP]civitfun: avoid headers conflict --- pms_civitfun/services/pms_checkin_partner_service.py | 2 +- pms_civitfun/services/pms_reservation_service.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pms_civitfun/services/pms_checkin_partner_service.py b/pms_civitfun/services/pms_checkin_partner_service.py index a40f1ab85f..5045f09117 100644 --- a/pms_civitfun/services/pms_checkin_partner_service.py +++ b/pms_civitfun/services/pms_checkin_partner_service.py @@ -33,7 +33,7 @@ class PmsReservationService(Component): ], input_param=Datamodel("civitfun.guest.meta", is_list=False), output_param=Datamodel("civitfun.guest.meta.result", is_list=False), - auth="jwt_civitfun", + auth="public", ) def register_hosts(self, pms_input_param): try: diff --git a/pms_civitfun/services/pms_reservation_service.py b/pms_civitfun/services/pms_reservation_service.py index 023f9def54..ddac6c7c3d 100644 --- a/pms_civitfun/services/pms_reservation_service.py +++ b/pms_civitfun/services/pms_reservation_service.py @@ -34,7 +34,7 @@ class CivitfunReservationService(Component): ], input_param=Datamodel("civitfun.reservation.search.info", is_list=False), output_param=Datamodel("civitfun.booking.results", is_list=False), - auth="jwt_civitfun", + auth="public", ) def get_reservations(self, pms_search_param): try: @@ -127,11 +127,11 @@ def _mapped_reservation_info(self, reservation): holderCountry=reservation.partner_id.country_id.code_alpha3 if reservation.partner_id.country_id else None, - email=reservation.email, + email=reservation.email or None, entrance=reservation.checkin.strftime(FORMAT_DATE), - entranceTime=reservation.arrival_hour, + entranceTime=reservation.arrival_hour or None, departure=reservation.checkout.strftime(FORMAT_DATE), - departureTime=reservation.departure_hour, + departureTime=reservation.departure_hour or None, adults=reservation.adults, babies=0, children=reservation.children, @@ -173,6 +173,7 @@ def _mapped_guests(self, reservation): position=reservation.checkin_partner_ids.ids.index(checkin.id) + 1, email=checkin.email or None, lang=checkin.partner_id.lang or None, + language=checkin.partner_id.lang or None, name=checkin.firstname or None, surname=checkin.lastname or None, secondSurname=checkin.lastname2 or None,