Skip to content

Commit

Permalink
Fix bug where calling logic.action.get:dashboard_activity_list() was …
Browse files Browse the repository at this point in the history
…affecting the pkg_dict in an activity list used by dataset_follower_count() - using copy.
  • Loading branch information
David Read committed Feb 2, 2019
1 parent 5fb7d07 commit a8d466d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ckan/lib/dictization/model_dictize.py
Expand Up @@ -13,6 +13,7 @@
'''
import datetime
import urlparse
import copy

from ckan.common import config
from sqlalchemy.sql import select
Expand Down Expand Up @@ -636,6 +637,9 @@ def vocabulary_list_dictize(vocabulary_list, context):
def activity_dictize(activity, context, include_data=False):
activity_dict = d.table_dictize(activity, context)
if not include_data:
# take a copy of the activity data, since the original may be used
# elsewhere during the same render and we don't want to affect that
activity_dict['data'] = copy.deepcopy(activity_dict['data'])
# delete all the data apart from the title field on each data object,
# because that is needed to display it in the activity stream
for obj_key in activity_dict['data'].keys():
Expand Down

0 comments on commit a8d466d

Please sign in to comment.