From aedb702c385b99856c1ec7a592d3f1ae3f44fa2f Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 5 Jan 2024 10:42:48 +0100 Subject: [PATCH] travelynx does not render newlines in comments --- importer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/importer.py b/importer.py index 4ceea4f..23f4bcc 100644 --- a/importer.py +++ b/importer.py @@ -66,9 +66,9 @@ for checkin in sorted(checkins, key=lambda c: c["createdAt"]): train_type = checkin["train"]["lineName"].split(" ")[0] comment = [f"Import from Traewelling, ID {checkin['id']}"] if checkin["body"]: - comment.extend(["", checkin["body"]]) + comment.append(checkin["body"]) if checkin["event"]: - comment.extend(["", checkin["event"]["name"], checkin["event"]["url"]]) + comment.extend([checkin["event"]["name"], checkin["event"]["url"]]) travelynx_data = { "token": TRAVELYNX_API_TOKEN, "dryRun": False, @@ -114,7 +114,7 @@ for checkin in sorted(checkins, key=lambda c: c["createdAt"]): else None, }, # "intermediateStops": [], - "comment": "\n".join(comment), + "comment": " - ".join(comment), } l.debug(json.dumps(travelynx_data)) r = s.post(