Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix URL endpoints #524

Merged
merged 5 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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