Skip to content

Commit

Permalink
[#626] Add display_name to group/org list for user action
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes authored and amercader committed Jul 1, 2013
1 parent db06a43 commit 913831d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ckan/logic/action/get.py
Expand Up @@ -469,7 +469,10 @@ def group_list_authz(context, data_dict):
if package:
groups = set(groups) - set(package.get_groups())

return [{'id': group.id, 'name': group.name, 'type': group.type} for group in groups]
return [{'id': group.id,
'name': group.name,
'display_name': group.display_name,
'type': group.type} for group in groups]

def organization_list_for_user(context, data_dict):
'''Return the list of organizations that the user is a member of.
Expand Down Expand Up @@ -519,8 +522,11 @@ def organization_list_for_user(context, data_dict):

orgs_q = orgs_q.filter(model.Group.id.in_(group_ids))

return [{'id': org.id, 'name': org.name, 'title': org.title, 'type': org.type}
for org in orgs_q.all()]
return [{'id': org.id,
'name': org.name,
'title': org.title,
'display_name': org.display_name,
'type': org.type} for org in orgs_q.all()]

def group_revision_list(context, data_dict):
'''Return a group's revisions.
Expand Down

0 comments on commit 913831d

Please sign in to comment.