Skip to content

Commit

Permalink
Merge pull request #142 from qld-gov-au/QOLDEV-933-purl-improvements
Browse files Browse the repository at this point in the history
QOLDEV-933 remove incorrect error message
  • Loading branch information
ThrawnCA authored Sep 20, 2024
2 parents 1920d41 + 6cbbcf5 commit 838b25c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckanext/qgov/common/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 838b25c

Please sign in to comment.