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
# Copyright (C) 2015 Pietro Albini <>
# Copyright (C) 2015-2016 Pietro Albini <>
# 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
......@@ -45,6 +45,10 @@ def remove(path, recursive=False):
def after_request(response):
"""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
# Get the function for the current app
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment