Fixed missing offer comment causing validation error
This commit is contained in:
@@ -745,17 +745,20 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
|
|||||||
hotel_name=reservation.hotel_name,
|
hotel_name=reservation.hotel_name,
|
||||||
)
|
)
|
||||||
# Comments
|
# Comments
|
||||||
offer_comment = CommentData(
|
|
||||||
name=CommentName2.ADDITIONAL_INFO,
|
offer_comment = None
|
||||||
text="Angebot/Offerta",
|
if reservation.offer is not None:
|
||||||
list_items=[
|
offer_comment = CommentData(
|
||||||
CommentListItemData(
|
name=CommentName2.ADDITIONAL_INFO,
|
||||||
value=reservation.offer,
|
text="Angebot/Offerta",
|
||||||
language=customer.language,
|
list_items=[
|
||||||
list_item="1",
|
CommentListItemData(
|
||||||
)
|
value=reservation.offer,
|
||||||
],
|
language=customer.language,
|
||||||
)
|
list_item="1",
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
comment = None
|
comment = None
|
||||||
if reservation.user_comment:
|
if reservation.user_comment:
|
||||||
comment = CommentData(
|
comment = CommentData(
|
||||||
@@ -776,6 +779,10 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
|
|||||||
|
|
||||||
comments_xml = None
|
comments_xml = None
|
||||||
if comments:
|
if comments:
|
||||||
|
|
||||||
|
for c in comments:
|
||||||
|
_LOGGER.info(f"Creating comment: name={c.name}, text={c.text}, list_items={len(c.list_items)}")
|
||||||
|
|
||||||
comments_data = CommentsData(comments=comments)
|
comments_data = CommentsData(comments=comments)
|
||||||
comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE)
|
comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user