diff --git a/ckanext/odsh/controller.py b/ckanext/odsh/controller.py index cd31360d9675761baba04c8edbca37a8b88569b3..dd68bdd3f3d8cbea7d0400f494915edf738c44f5 100644 --- a/ckanext/odsh/controller.py +++ b/ckanext/odsh/controller.py @@ -28,52 +28,6 @@ render = base.render get_action = logic.get_action -class OdshGroupController(OrganizationController): - - def _action(self, name): - - action = super(OdshGroupController, self)._action(name) - - def custom_org_list(context, data_dict): - sort_desc = data_dict['sort'] == 'name desc' - d = data_dict.copy() - if 'offset' in d: - del d['offset'] - del d['limit'] - # print(data_dict) - if d["type"] != 'organization': - return action(context, d) - all = d['all_fields'] - query = d['q'] - result = action(context, d) - seen = set([(r['id'] if all else r) for r in result]) - for q in query.split(' '): - d['q'] = q - ret = action(context, d) - for r in ret: - id = r['id'] if all else r - if id not in seen: - result.append(r) - seen.add(id) - - if all: - result = sorted( - result, key=lambda k: k['name'], reverse=sort_desc) - else: - result = sorted(result, reverse=sort_desc) - - if 'offset' in data_dict: - off = data_dict['offset'] - limit = data_dict['limit'] - return result[off:off+limit] - return result - - if name == 'group_list': - return custom_org_list - else: - return super(OdshGroupController, self)._action(name) - - class OdshApiController(ApiController): def action(self, logic_function, ver=None): if toolkit.asbool(config.get('ckanext.odsh.log_api_requests', 'false')): diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 6eb9af0923e80963ea0297ab1fb69b10fcf2e588..3e7acd93942f2089ba05786fb7006d1d7c978fe2 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -308,9 +308,6 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm with SubMapper(map, controller='ckanext.odsh.controller:OdshFeedController') as m: m.connect('/feeds/custom.atom', action='custom') - with SubMapper(map, controller='ckanext.odsh.controller:OdshGroupController') as m: - m.connect('organizations_index', '/organization', action='index') - # redirect all user routes to custom controller # with SubMapper(map, controller='ckanext.odsh.controller:OdshUserController') as m: # m.connect('/user/edit', action='edit')