[FIX]pms_api_rest: Agency without image

This commit is contained in:
Darío Lodeiros
2022-07-07 19:01:51 +02:00
parent 1182269c65
commit b6a991a1ee
2 changed files with 5 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ class PmsCancelationRuleSearchParam(Datamodel):
pricelistId = fields.Integer(required=False, allow_none=True)
pmsPropertyId = fields.String(required=False, allow_none=True)
class PmsCancelationRuleInfo(Datamodel):
_name = "pms.cancelation.rule.info"
id = fields.Integer(required=True, allow_none=False)

View File

@@ -155,7 +155,7 @@ class PmsFolioService(Component):
if reservation.agency_id
else None,
"agencyImage": reservation.agency_id.image_1024.decode("utf-8")
if reservation.agency_id
if reservation.agency_id and reservation.agency_id.image_1024
else None,
"state": reservation.state if reservation.state else None,
"roomTypeCode": reservation.room_type_id.default_code
@@ -200,7 +200,9 @@ class PmsFolioService(Component):
if folio.payment_state
else None,
propertyId=folio.pms_property_id,
agencyImage=folio.agency_id.image_1024 if folio.agency_id else None,
agencyImage=folio.agency_id.image_1024
if folio.agency_id and folio.agency_id.image_1024
else None,
)
)
return result_folios