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