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,13 +33,14 @@ class Navbar:
def current_navbars(self):
"""Get the list of current navbars"""
if flask.request.endpoint is not None:
matcher = (flask.request.endpoint, tuple(flask.request.view_args.items()))
if matcher in self.match:
return self._return_navbars(self.match[matcher])
elif flask.request.endpoint in self.match:
return self._return_navbars(self.match[flask.request.endpoint])
else:
return self._return_navbars([(0, -1)])
def _return_navbars(self, 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