From fd6ff38000ad2c752b3dc11c12e5e5b416412ed7 Mon Sep 17 00:00:00 2001 From: Mark Calvert Date: Mon, 13 Jun 2022 11:27:09 +1200 Subject: [PATCH] Added missing toolkit abort import --- ckanext/fortify/blueprint.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ckanext/fortify/blueprint.py b/ckanext/fortify/blueprint.py index d07dab9..438a07e 100644 --- a/ckanext/fortify/blueprint.py +++ b/ckanext/fortify/blueprint.py @@ -25,6 +25,7 @@ _ = toolkit._ config = toolkit.config asbool = toolkit.asbool +abort = toolkit.abort fortify = Blueprint(u'fortify', __name__) @@ -134,7 +135,7 @@ def download(package_type, id, resource_id, filename=None): rsc = get_action(u'resource_show')(context, {u'id': resource_id}) get_action(u'package_show')(context, {u'id': id}) except (NotFound, NotAuthorized): - return base.abort(404, _(u'Resource not found')) + return abort(404, _(u'Resource not found')) if rsc.get(u'url_type') == u'upload': upload = uploader.get_resource_uploader(rsc) @@ -148,7 +149,7 @@ def download(package_type, id, resource_id, filename=None): return flask.send_file(filepath) # Fortify updates end elif u'url' not in rsc: - return base.abort(404, _(u'No download is available')) + return abort(404, _(u'No download is available')) return h.redirect_to(rsc[u'url']) fortify.add_url_rule(