Skip to content

Commit

Permalink
Merge branch 'master' of github.com:okfn/ckan into 847-new-theming-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Nov 20, 2013
2 parents 983bb02 + f0486e4 commit ea7b28a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
10 changes: 3 additions & 7 deletions ckan/controllers/group.py
Expand Up @@ -760,11 +760,8 @@ def activity(self, id, offset=0):

context = {'model': model, 'session': model.Session,
'user': c.user or c.author, 'for_view': True}
data_dict = {'id': id}

try:
c.group_dict = get_action('group_show')(context, data_dict)
c.group = context['group']
c.group_dict = self._get_group_dict(id)
except NotFound:
abort(404, _('Group not found'))
except NotAuthorized:
Expand All @@ -774,10 +771,9 @@ def activity(self, id, offset=0):

# Add the group's activity stream (already rendered to HTML) to the
# template context for the group/read.html template to retrieve later.
c.group_activity_stream = get_action('group_activity_list_html')(
c.group_activity_stream = self._action('group_activity_list_html')(
context, {'id': c.group_dict['id'], 'offset': offset})

#return render('group/activity_stream.html')
return render(self._activity_template(c.group_dict['type']))

def follow(self, id):
Expand Down Expand Up @@ -847,7 +843,7 @@ def _get_group_dict(self, id):
'user': c.user or c.author,
'for_view': True}
try:
return get_action('group_show')(context, {'id': id})
return self._action('group_show')(context, {'id': id})
except NotFound:
abort(404, _('Group not found'))
except NotAuthorized:
Expand Down
11 changes: 10 additions & 1 deletion ckan/logic/action/get.py
Expand Up @@ -2329,7 +2329,16 @@ def organization_activity_list_html(context, data_dict):
'''
activity_stream = organization_activity_list(context, data_dict)
return activity_streams.activity_list_to_html(context, activity_stream)
offset = int(data_dict.get('offset', 0))
extra_vars = {
'controller': 'organization',
'action': 'activity',
'id': data_dict['id'],
'offset': offset,
}

return activity_streams.activity_list_to_html(context, activity_stream,
extra_vars)

def recently_changed_packages_activity_list_html(context, data_dict):
'''Return the activity stream of all recently changed packages as HTML.
Expand Down

0 comments on commit ea7b28a

Please sign in to comment.