Skip to content

Commit

Permalink
[#2939] Add creator of org/group as admin
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 2, 2012
1 parent 3c3ce44 commit fa746c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ckan/logic/action/create.py
Expand Up @@ -538,6 +538,15 @@ def _group_or_org_create(context, data_dict, is_org=False):
logic.get_action('activity_create')(activity_create_context,
activity_dict, ignore_auth=True)

# creator of group/org becomes an admin
member_dict = {
'id': group.id,
'object': user,
'object_type': 'user',
'capacity': 'admin',
}
logic.action_get('member_create')(context, member_dict)

if not context.get('defer_commit'):
model.repo.commit()
context["group"] = group
Expand Down

0 comments on commit fa746c0

Please sign in to comment.