Skip to content

Commit

Permalink
[#2939] Move the membership adding so that the revision table works
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 3, 2012
1 parent c5969b8 commit 2ca6d88
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ckan/logic/action/create.py
Expand Up @@ -538,7 +538,13 @@ def _group_or_org_create(context, data_dict, is_org=False):
logic.get_action('activity_create')(activity_create_context,
activity_dict, ignore_auth=True)

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

# creator of group/org becomes an admin
# this needs to be after the repo.commit or else revisions break
member_dict = {
'id': group.id,
'object': user,
Expand All @@ -547,10 +553,6 @@ def _group_or_org_create(context, data_dict, is_org=False):
}
logic.get_action('member_create')(context, member_dict)

if not context.get('defer_commit'):
model.repo.commit()
context["group"] = group
context["id"] = group.id
log.debug('Created object %s' % str(group.name))
return model_dictize.group_dictize(group, context)

Expand Down

0 comments on commit 2ca6d88

Please sign in to comment.