Skip to content

Commit

Permalink
Merge pull request #524 from ckan/fix-url-endpoints
Browse files Browse the repository at this point in the history
Fix URL endpoints
  • Loading branch information
pdelboca authored Mar 28, 2023
2 parents 33f1771 + 40810cd commit 6a47510
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ckanext/harvest/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = '<a href="{url}">{text}</a>'.format(url=url, text=text)

Expand Down
2 changes: 1 addition & 1 deletion ckanext/harvest/templates/source/job/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h3>{{ _('Document Errors') }}
{{ _('Remote content') }}
</a>
{% endif %}
<a href="{{ h.url_for('harvest.object_show', id=harvest_object_id) }}" class="btn btn-small">
<a href="{{ h.url_for('harvester.object_show', id=harvest_object_id) }}" class="btn btn-small">
{{ _('Local content') }}
</a>

Expand Down
2 changes: 1 addition & 1 deletion ckanext/harvest/templates/source/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}

Expand Down
8 changes: 2 additions & 6 deletions ckanext/harvest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.params.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})

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

version = '1.5.1'
version = '1.5.2'

setup(
name='ckanext-harvest',
Expand Down

0 comments on commit 6a47510

Please sign in to comment.