Skip to content

Commit

Permalink
[xs] Fixing problem with 404 when requesting related items
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed May 8, 2012
1 parent c8239b4 commit d646258
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ckan/controllers/related.py
Expand Up @@ -18,17 +18,19 @@ def list(self, id):

try:
logic.check_access('package_show', context, data_dict)
except logic.NotFound:
base.abort(404, base._('Dataset not found'))
except logic.NotAuthorized:
abort(401, _('Not authorized to see this page'))
base.abort(401, base._('Not authorized to see this page'))

try:
c.pkg_dict = logic.get_action('package_show')(context, data_dict)
c.pkg = context['package']
c.resources_json = h.json.dumps(c.pkg_dict.get('resources',[]))
except logic.NotFound:
abort(404, _('Dataset not found'))
base.abort(404, base._('Dataset not found'))
except logic.NotAuthorized:
abort(401, _('Unauthorized to read package %s') % id)
base.abort(401, base._('Unauthorized to read package %s') % id)

c.related_count = len(c.pkg.related)

Expand Down

0 comments on commit d646258

Please sign in to comment.