From 4fddafcb56dd8e91e8fad6567cd6dd8856b2f816 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 28 Mar 2023 09:13:59 -0300 Subject: [PATCH 1/5] Fix endpoint for object_show --- ckanext/harvest/helpers.py | 2 +- ckanext/harvest/templates/source/job/read.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ckanext/harvest/helpers.py b/ckanext/harvest/helpers.py index 87b3e3c5..34696ad0 100644 --- a/ckanext/harvest/helpers.py +++ b/ckanext/harvest/helpers.py @@ -124,7 +124,7 @@ def link_for_harvest_object(id=None, guid=None, text=None): obj = logic.get_action('harvest_object_show')(context, {'id': guid, 'attr': 'guid'}) id = obj.id - url = h.url_for('harvest.object_show', id=id) + url = h.url_for('harvester.object_show', id=id) text = text or guid or id link = '{text}'.format(url=url, text=text) diff --git a/ckanext/harvest/templates/source/job/read.html b/ckanext/harvest/templates/source/job/read.html index 25d32e12..87e16c6a 100644 --- a/ckanext/harvest/templates/source/job/read.html +++ b/ckanext/harvest/templates/source/job/read.html @@ -69,7 +69,7 @@

{{ _('Document Errors') }} {{ _('Remote content') }} {% endif %} - + {{ _('Local content') }} From b6c87f4cec0fd1010796b68976380222407360d9 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 28 Mar 2023 09:15:10 -0300 Subject: [PATCH 2/5] Clean deprecated params attribute --- ckanext/harvest/helpers.py | 2 +- ckanext/harvest/templates/source/search.html | 2 +- ckanext/harvest/utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ckanext/harvest/helpers.py b/ckanext/harvest/helpers.py index 34696ad0..c1b452e7 100644 --- a/ckanext/harvest/helpers.py +++ b/ckanext/harvest/helpers.py @@ -36,7 +36,7 @@ def package_list_for_source(source_id): It calls the package_list snippet and the pager. ''' limit = 20 - page = int(request.params.get('page', 1)) + page = int(request.args.get('page', 1)) fq = '+harvest_source_id:"{0}"'.format(source_id) search_dict = { 'fq': fq, diff --git a/ckanext/harvest/templates/source/search.html b/ckanext/harvest/templates/source/search.html index a9299432..d9ceeeaa 100644 --- a/ckanext/harvest/templates/source/search.html +++ b/ckanext/harvest/templates/source/search.html @@ -31,7 +31,7 @@ (_('Last Modified'), 'metadata_modified desc'), (_('Popular'), 'views_recent desc') if g.tracking_enabled else (false, false) ] %} - {% snippet 'snippets/search_form.html', type='harvest', query=c.q, sorting=sorting, sorting_selected=c.sort_by_selected, count=c.page.item_count, facets=facets, show_empty=request.params, error=c.query_error, placeholder=_("Search harvest sources...") %} + {% snippet 'snippets/search_form.html', type='harvest', query=c.q, sorting=sorting, sorting_selected=c.sort_by_selected, count=c.page.item_count, facets=facets, show_empty=request.args, error=c.query_error, placeholder=_("Search harvest sources...") %} {{ h.snippet('snippets/source_list.html', sources=c.page.items, show_organization=true) }} diff --git a/ckanext/harvest/utils.py b/ckanext/harvest/utils.py index ca61490c..557e883f 100644 --- a/ckanext/harvest/utils.py +++ b/ckanext/harvest/utils.py @@ -687,7 +687,7 @@ def delete_view(id): try: context = {'model': model, 'user': tk.c.user} - context['clear_source'] = tk.request.params.get('clear', + context['clear_source'] = tk.request.args.get('clear', '').lower() in ( u'true', u'1', From 540716860a9ab3de8d00cb5a0aa398aa552e1705 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 28 Mar 2023 09:52:42 -0300 Subject: [PATCH 3/5] Fix lint --- ckanext/harvest/utils.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ckanext/harvest/utils.py b/ckanext/harvest/utils.py index 557e883f..c17cc74e 100644 --- a/ckanext/harvest/utils.py +++ b/ckanext/harvest/utils.py @@ -686,12 +686,8 @@ def clear_view(id): def delete_view(id): try: context = {'model': model, 'user': tk.c.user} - - context['clear_source'] = tk.request.args.get('clear', - '').lower() in ( - u'true', - u'1', - ) + clear = tk.request.args.get('clear','').lower() + context['clear_source'] = clear in ('true','1',) tk.get_action('harvest_source_delete')(context, {'id': id}) From 85ae74514ec42f0300d94a22adf8b7cd344630f1 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 28 Mar 2023 13:49:47 -0300 Subject: [PATCH 4/5] Fix lint --- ckanext/harvest/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ckanext/harvest/utils.py b/ckanext/harvest/utils.py index c17cc74e..a58c7f59 100644 --- a/ckanext/harvest/utils.py +++ b/ckanext/harvest/utils.py @@ -686,8 +686,8 @@ def clear_view(id): def delete_view(id): try: context = {'model': model, 'user': tk.c.user} - clear = tk.request.args.get('clear','').lower() - context['clear_source'] = clear in ('true','1',) + clear = tk.request.args.get('clear', '').lower() + context['clear_source'] = clear in ('true', '1', ) tk.get_action('harvest_source_delete')(context, {'id': id}) From 40810cd0342592b0e83cb356b8cea8c807f251dd Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 28 Mar 2023 13:50:03 -0300 Subject: [PATCH 5/5] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c87d225e..869d1111 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '1.5.1' +version = '1.5.2' setup( name='ckanext-harvest',