Commit e485a662 authored by Pietro Albini's avatar Pietro Albini

Fix 500 error on 404 page

parent 13f41449
Pipeline #67 passed with stage
in 0 seconds
...@@ -33,14 +33,15 @@ class Navbar: ...@@ -33,14 +33,15 @@ class Navbar:
def current_navbars(self): def current_navbars(self):
"""Get the list of current navbars""" """Get the list of current navbars"""
matcher = (flask.request.endpoint, tuple(flask.request.view_args.items())) if flask.request.endpoint is not None:
matcher = (flask.request.endpoint, tuple(flask.request.view_args.items()))
if matcher in self.match: if matcher in self.match:
return self._return_navbars(self.match[matcher]) return self._return_navbars(self.match[matcher])
elif flask.request.endpoint in self.match: elif flask.request.endpoint in self.match:
return self._return_navbars(self.match[flask.request.endpoint]) return self._return_navbars(self.match[flask.request.endpoint])
else:
return self._return_navbars([(0, -1)]) return self._return_navbars([(0, -1)])
def _return_navbars(self, navbars): def _return_navbars(self, navbars):
"""Return a list of navbars""" """Return a list of navbars"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment