Skip to content

Commit

Permalink
Merge branch 'release-1.22.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zharktas committed Apr 20, 2015
2 parents 1c9f823 + cd6f96d commit 7d25a8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@ def add_to_ancestors(id, value, counts):
counts[id] += value
parents = child_parents_map.get(id, [])
if parents:
for p in parents:
add_to_ancestors(p, value, counts)
for parent in parents:
add_to_ancestors(parent, value, counts)

for group in groups:
if group.dataset_count:
add_to_ancestors(group.id, group.dataset_count, dataset_count_map)

return dataset_count_map


def _fetch_all_organizations(force_root_ids=None):
groups_with_counts = model.Session.query(model.Group, func.count(model.Package.id)) \
.outerjoin(model.Package, model.Package.owner_org == model.Group.id) \
.filter(or_(model.Package.state == u'active', model.Package.state == None)) \
.filter(model.Group.state == u'active') \
.filter(model.Group.is_organization.is_(True)) \
.group_by(model.Group.id) \
.all()
.all() # noqa

parent_group = aliased(model.Group)
members = model.Session.query(model.Member) \
Expand All @@ -43,7 +44,7 @@ def _fetch_all_organizations(force_root_ids=None):
.filter(model.Group.is_organization.is_(True)) \
.filter(model.Member.state == u'active')\
.all()

extras = model.Session.query(model.GroupExtra.group_id, model.GroupExtra.key, model.GroupExtra.value) \
.join(model.Group, model.GroupExtra.group_id == model.Group.id) \
.filter(model.Group.state == u'active') \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import ast
import datetime
from ckanext.ytp.common.helpers import extra_translation
import itertools

from ckan.config.routing import SubMapper

Expand Down

0 comments on commit 7d25a8b

Please sign in to comment.