From 6278186470c2917c77e6cc5cbf464bbeb6588fc7 Mon Sep 17 00:00:00 2001 From: Sergey Motornyuk Date: Thu, 13 Jul 2023 17:28:13 +0300 Subject: [PATCH] fix: wrong endpoint name for redirect after page removal --- ckanext/pages/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/pages/utils.py b/ckanext/pages/utils.py index 924784b5..9d8a67fd 100644 --- a/ckanext/pages/utils.py +++ b/ckanext/pages/utils.py @@ -196,7 +196,7 @@ def pages_delete(page, page_type='pages'): try: if tk.request.method == 'POST': tk.get_action('ckanext_pages_delete')({}, {'page': page}) - endpoint = 'index' if page_type in ('pages', 'page') else '%s_index' % page_type + endpoint = page_type + '_index' return tk.redirect_to('pages.%s' % endpoint) else: return tk.abort(404, _('Page Not Found'))