summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-09-01 21:39:44 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-09-01 21:39:44 +0200
commit1ba316ff601c5c385be01e40ffa9bfcfc6ebbcb3 (patch)
tree495e74528758a5ef0c029360bb0bced53afc167b
parent44f420864312f8269e2f5e479257588e5308120d (diff)
handle results without direction0.6.0
-rwxr-xr-xbin/nvm9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/nvm b/bin/nvm
index 6996654..326fa6a 100755
--- a/bin/nvm
+++ b/bin/nvm
@@ -164,7 +164,7 @@ class Trip:
self.cancelled = None
self.__dict__.update(obj)
- if "," in self.direction:
+ if self.direction is not None and "," in self.direction:
self.direction, self.suffix = self.direction.split(",", maxsplit=1)
else:
self.suffix = None
@@ -425,9 +425,14 @@ async def show_trip_info(request, trip_id=None):
tripinfo_page = env.get_template("tripinfo_page.html")
+ if tripinfo.direction:
+ page_title = tripinfo.line["name"] + " ➔ " + tripinfo.direction
+ else:
+ page_title = tripinfo.line["name"]
+
return web.Response(
body=tripinfo_page.render(
- title=tripinfo.line["name"] + " ➔ " + tripinfo.direction,
+ title=page_title,
tripinfo=tripinfo,
version=nvm_version,
),