diff --git a/ckanext/qgov/common/plugin.py b/ckanext/qgov/common/plugin.py index e0da4b9..2e9dc86 100644 --- a/ckanext/qgov/common/plugin.py +++ b/ckanext/qgov/common/plugin.py @@ -154,9 +154,11 @@ def make_middleware(self, app, config): if hasattr(app, 'errorhandler'): @app.errorhandler(404) def handle_not_found(e): - from flask import redirect, request + from flask import redirect, request, get_flashed_messages redirect_url = urlm.get_purl_response(request.base_url) if redirect_url: + # eat the 'page not found' message as it's obsolete + get_flashed_messages() return redirect(redirect_url, 301) else: # copy default error handling