Commit 50efd1cf authored by Pietro Albini's avatar Pietro Albini

Don't crash if a page hasn't an endpoint

parent fad8cf5e
# Source code of the Ubuntu-it website # Source code of the Ubuntu-it website
# Copyright (C) 2015 Pietro Albini <pietroalbini@ubuntu.com> # Copyright (C) 2015-2016 Pietro Albini <pietroalbini@ubuntu.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published # it under the terms of the GNU Affero General Public License as published
...@@ -45,6 +45,10 @@ def remove(path, recursive=False): ...@@ -45,6 +45,10 @@ def remove(path, recursive=False):
def after_request(response): def after_request(response):
"""Hook meant to be executed after a request""" """Hook meant to be executed after a request"""
# Don't do anything if the page hasn't an endpoint
if flask.request.endpoint is None:
return response
app = flask.current_app app = flask.current_app
# Get the function for the current app # Get the function for the current app
......
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