Skip to content

Commit

Permalink
Merge pull request #1359 from okfn/1359-org_rev_list-missing
Browse files Browse the repository at this point in the history
Exception when visiting org history page
  • Loading branch information
kindly committed Dec 9, 2013
2 parents 4e89ef8 + e80e45e commit 8ba294f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
30 changes: 28 additions & 2 deletions ckan/logic/action/get.py
Expand Up @@ -552,7 +552,8 @@ def organization_list_for_user(context, data_dict):
orgs_list = model_dictize.group_list_dictize(orgs_q.all(), context)
return orgs_list

def group_revision_list(context, data_dict):

def _group_or_org_revision_list(context, data_dict):
'''Return a group's revisions.
:param id: the name or id of the group
Expand All @@ -567,7 +568,6 @@ def group_revision_list(context, data_dict):
if group is None:
raise NotFound

_check_access('group_revision_list',context, data_dict)

revision_dicts = []
for revision, object_revisions in group.all_related_revisions:
Expand All @@ -576,6 +576,32 @@ def group_revision_list(context, data_dict):
include_groups=False))
return revision_dicts

def group_revision_list(context, data_dict):
'''Return a group's revisions.
:param id: the name or id of the group
:type id: string
:rtype: list of dictionaries
'''

_check_access('group_revision_list',context, data_dict)
return _group_or_org_revision_list(context, data_dict)

def organization_revision_list(context, data_dict):
'''Return an organization's revisions.
:param id: the name or id of the organization
:type id: string
:rtype: list of dictionaries
'''

_check_access('organization_revision_list',context, data_dict)
return _group_or_org_revision_list(context, data_dict)

def license_list(context, data_dict):
'''Return the list of licenses available for datasets on the site.
Expand Down
3 changes: 3 additions & 0 deletions ckan/logic/auth/get.py
Expand Up @@ -39,6 +39,9 @@ def revision_list(context, data_dict):
def group_revision_list(context, data_dict):
return group_show(context, data_dict)

def organization_revision_list(context, data_dict):
return group_show(context, data_dict)

def package_revision_list(context, data_dict):
return package_show(context, data_dict)

Expand Down

0 comments on commit 8ba294f

Please sign in to comment.