Skip to content

Commit

Permalink
[#2939] Helper Organizations activities created
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Sep 27, 2012
1 parent dbf6776 commit e1818f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ckan/logic/action/create.py
Expand Up @@ -506,10 +506,15 @@ def _group_or_org_create(context, data_dict, is_org=False):
for item in plugins.PluginImplementations(plugins.IGroupController):
item.create(group)

if is_org:
activity_type = 'new organization'
else:
activity_type = 'new group'

activity_dict = {
'user_id': model.User.by_name(user.decode('utf8')).id,
'object_id': group.id,
'activity_type': 'new group',
'activity_type': activity_type,
}
activity_dict['data'] = {
'group': ckan.lib.dictization.table_dictize(group, context)
Expand Down
7 changes: 6 additions & 1 deletion ckan/logic/action/update.py
Expand Up @@ -459,10 +459,15 @@ def _group_or_org_update(context, data_dict, is_org=False):
for item in plugins.PluginImplementations(plugins.IGroupController):
item.edit(group)

if is_org:
activity_type = 'changed organization'
else:
activity_type = 'changed group'

activity_dict = {
'user_id': model.User.by_name(user.decode('utf8')).id,
'object_id': group.id,
'activity_type': 'changed group',
'activity_type': activity_type,
}
# Handle 'deleted' groups.
# When the user marks a group as deleted this comes through here as
Expand Down

0 comments on commit e1818f5

Please sign in to comment.