From 73284147bb479d3b28f38db308ee0feb49270155 Mon Sep 17 00:00:00 2001 From: tobes Date: Tue, 2 Oct 2012 10:34:35 +0100 Subject: [PATCH] [#2939] Fixes for solr indexing --- ckan/lib/search/index.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ckan/lib/search/index.py b/ckan/lib/search/index.py index dee7e27c7e8..b040242e450 100644 --- a/ckan/lib/search/index.py +++ b/ckan/lib/search/index.py @@ -145,16 +145,16 @@ def index_package(self, pkg_dict, defer_commit=False): # add groups groups = pkg_dict.pop('groups', []) - # Capacity is different to the default only if using organizations - # where the dataset is only in one group. We will add the capacity - # from the single group that it is a part of if we have a group - if len(groups): - pkg_dict['capacity'] = groups[0].get('capacity', 'public') - else: - pkg_dict['capacity'] = 'public' + pkg_dict['capacity'] = 'public' pkg_dict['groups'] = [group['name'] for group in groups] + # if there is an owner_org we want to add this to groups for index + # purposes + if pkg_dict['owner_org']: + pkg_dict['groups'].append(pkg_dict['organization']['name']) + + # tracking tracking_summary = pkg_dict.pop('tracking_summary', None) if tracking_summary: