Skip to content

Commit

Permalink
[#2722] fix group dataset sort
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 13, 2012
1 parent 5d30fdb commit 34e8730
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/controllers/group.py
Expand Up @@ -139,6 +139,7 @@ def read(self, id):
# most search operations should reset the page counter:
params_nopage = [(k, v) for k, v in request.params.items()
if k != 'page']
sort_by = request.params.get('sort', 'name asc')

def search_url(params):
url = h.url_for(controller='group', action='read',
Expand Down Expand Up @@ -170,7 +171,7 @@ def pager_url(q=None, page=None):
c.fields = []
search_extras = {}
for (param, value) in request.params.items():
if not param in ['q', 'page'] \
if not param in ['q', 'page', 'sort'] \
and len(value) and not param.startswith('_'):
if not param.startswith('ext_'):
c.fields.append((param, value))
Expand All @@ -188,6 +189,7 @@ def pager_url(q=None, page=None):
'fq': fq,
'facet.field': g.facets,
'rows': limit,
'sort': sort_by,
'start': (page - 1) * limit,
'extras': search_extras
}
Expand Down

0 comments on commit 34e8730

Please sign in to comment.