[#27] fix package_list_for_source for unowned data sources

This commit is contained in:
joetsoi 2013-03-21 11:54:02 +00:00
parent 7bff041568
commit d518b6709a
1 changed files with 5 additions and 3 deletions

View File

@ -28,9 +28,11 @@ def package_list_for_source(source_id):
context = {'model': model, 'session': model.Session} context = {'model': model, 'session': model.Session}
owner_org = p.toolkit.c.harvest_source.get('owner_org', '')
if owner_org:
user_member_of_orgs = [org['id'] for org user_member_of_orgs = [org['id'] for org
in h.organizations_available('read')] in h.organizations_available('read')]
if (p.toolkit.c.harvest_source and p.toolkit.c.harvest_source['owner_org'] in user_member_of_orgs): if (p.toolkit.c.harvest_source and owner_org in user_member_of_orgs):
context['ignore_capacity_check'] = True context['ignore_capacity_check'] = True
query = logic.get_action('package_search')(context, search_dict) query = logic.get_action('package_search')(context, search_dict)