Skip to content

Commit

Permalink
building url without controller and action
Browse files Browse the repository at this point in the history
  • Loading branch information
usingsky committed May 15, 2019
1 parent 983d0f7 commit 1b3f1c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ckan/views/group.py
Expand Up @@ -466,10 +466,12 @@ def read(group_type, is_organization, id=None, limit=20):
# if the user specified a group id, redirect to the group name
if data_dict['id'] == group_dict['id'] and \
data_dict['id'] != group_dict['name']:

url_with_name = h.url_for(u'{}.read'.format(group_type),
id=group_dict['name'])

return h.redirect_to(
h.add_url_param(
controller=group_type, action=u'read',
extras=dict(id=group_dict['name'])))
h.add_url_param(alternative_url=url_with_name))

# TODO: Remove
# ckan 2.9: Adding variables that were removed from c object for
Expand Down

0 comments on commit 1b3f1c3

Please sign in to comment.