Skip to content

Commit

Permalink
[#1384] Make the database query in related_list
Browse files Browse the repository at this point in the history
* We didn't actually do the database query in related_list if we
  didn't pass a dataset. This commit fixes that.
* Share the dictize function for both cases.
  • Loading branch information
nigelbabu committed Dec 12, 2013
1 parent 25926d9 commit e552048
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/logic/action/get.py
Expand Up @@ -262,10 +262,11 @@ def related_list(context, data_dict=None):

if data_dict.get('featured', False):
related_list = related_list.filter(model.Related.featured == 1)
related_items = related_list.all()
else:
relateds = model.Related.get_for_dataset(dataset, status='active')
related_items = (r.related for r in relateds)
related_list = model_dictize.related_list_dictize( related_items, context)
related_list = model_dictize.related_list_dictize( related_items, context)
return related_list


Expand Down

0 comments on commit e552048

Please sign in to comment.