diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-09-01 21:39:44 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-09-01 21:39:44 +0200 |
commit | 1ba316ff601c5c385be01e40ffa9bfcfc6ebbcb3 (patch) | |
tree | 495e74528758a5ef0c029360bb0bced53afc167b | |
parent | 44f420864312f8269e2f5e479257588e5308120d (diff) |
handle results without direction0.6.0
-rwxr-xr-x | bin/nvm | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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, ), |