Commit 1f79737b authored by Pietro Albini's avatar Pietro Albini

Fix authenticated pages were cached

parent ce6523e3
Pipeline #72 passed with stage
in 0 seconds
...@@ -61,6 +61,14 @@ def after_request(response): ...@@ -61,6 +61,14 @@ def after_request(response):
else: else:
cache_path = os.path.realpath(app.config["CACHE_PATH"]) cache_path = os.path.realpath(app.config["CACHE_PATH"])
# Don't cache the page if flashed messages were displayed
if flask.get_flashed_messages():
return response
# Don't cache the page if the user is authenticated
if "auth_name" in flask.g:
return response
url = flask.request.path url = flask.request.path
method = flask.request.method method = flask.request.method
status = response.status_code status = response.status_code
......
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