Skip to content

Commit

Permalink
[#1208] Fix wrong logic for search params
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader authored and wardi committed Feb 20, 2014
1 parent 128f899 commit 43eb050
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ckan/lib/dictization/model_dictize.py
Expand Up @@ -335,19 +335,18 @@ def group_dictize(group, context):
'rows': 0,
}

if include_datasets:
if group.is_organization:
q['fq'] = 'owner_org:"{0}"'.format(group.id)
else:
q['fq'] = 'groups:"{0}"'.format(group.name)

q['rows'] = 1000 # Only the first 1000 datasets are returned
is_group_member = (context.get('user') and
new_authz.has_user_permission_for_group_or_org(group.id, context.get('user'), 'read'))
if is_group_member:
context['ignore_capacity_check'] = True

if group.is_organization:
q['fq'] = 'owner_org:"{0}"'.format(group.id)
else:
q['fq'] = 'groups:"{0}"'.format(group.name)

is_group_member = (context.get('user') and
new_authz.has_user_permission_for_group_or_org(group.id, context.get('user'), 'read'))
if is_group_member:
context['ignore_capacity_check'] = True
if include_datasets:
q['rows'] = 1000 # Only the first 1000 datasets are returned

search_results = logic.get_action('package_search')(context, q)

Expand Down

0 comments on commit 43eb050

Please sign in to comment.