parent
3b3c59d49b
commit
1c399b1b1c
|
|
@ -17,7 +17,8 @@ class ICSParser:
|
||||||
end = event.get("DTEND").dt
|
end = event.get("DTEND").dt
|
||||||
description = event.get("DESCRIPTION", "")
|
description = event.get("DESCRIPTION", "")
|
||||||
if not description:
|
if not description:
|
||||||
self.logger.debug(f"Skipping event with start date {start.date()} due to missing description")
|
start_date = start if isinstance(start, datetime.date) else start.date()
|
||||||
|
self.logger.debug(f"Skipping event with start date {start_date} due to missing description")
|
||||||
continue
|
continue
|
||||||
pin_code = ""
|
pin_code = ""
|
||||||
for line in description.split("\n"):
|
for line in description.split("\n"):
|
||||||
|
|
@ -25,8 +26,8 @@ class ICSParser:
|
||||||
pin_code = line.split(": ")[1].strip()
|
pin_code = line.split(": ")[1].strip()
|
||||||
break
|
break
|
||||||
reservations.append({
|
reservations.append({
|
||||||
"check_in_date": start.date() if isinstance(start, datetime.datetime) else start,
|
"check_in_date": start if isinstance(start, datetime.date) else start.date(),
|
||||||
"check_out_date": end.date() if isinstance(end, datetime.datetime) else end,
|
"check_out_date": end if isinstance(end, datetime.date) else end.date(),
|
||||||
"guests": [{"name": "Airbnb Guest", "phone": pin_code}],
|
"guests": [{"name": "Airbnb Guest", "phone": pin_code}],
|
||||||
"status": "accepted"
|
"status": "accepted"
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue