Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Making tag paging more robust.

  • Loading branch information...
commit 93e7f103a1dcdf348de4e3d571f9f3ebd483015e 1 parent 70fc7e1
@davidread davidread authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 ckanext/dgu/controllers/tag.py
View
6 ckanext/dgu/controllers/tag.py
@@ -1,6 +1,7 @@
from ckan.controllers.tag import TagController as BaseTagController
from ckan import model
from ckan.lib.helpers import Page
+from ckan.lib.base import abort
from ckanext.dgu.lib.alphabet_paginate_large import AlphaPageLarge
from ckanext.dgu.plugins_toolkit import render, c, request, _, ObjectNotFound, NotAuthorized, ValidationError, get_action, check_access
from ckan.lib.base import h
@@ -21,7 +22,10 @@ def index(self):
data_dict = {'all_fields': False}
if c.q:
- page = int(request.params.get('page', 1))
+ try:
+ page = int(request.params.get('page', 1))
+ except ValueError:
+ abort(404, _('Not found'))
data_dict['q'] = c.q
data_dict['limit'] = LIMIT
data_dict['offset'] = (page-1)*LIMIT
Please sign in to comment.
Something went wrong with that request. Please try again.