Skip to content

Commit

Permalink
[#2856] Fix 500 error in related controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 16, 2012
1 parent 302c2f5 commit 3e65478
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ckan/controllers/related.py
Expand Up @@ -28,7 +28,7 @@ def dashboard(self):
try:
page = int(base.request.params.get('page', 1))
except ValueError, e:
abort(400, ('"page" parameter must be an integer'))
base.abort(400, ('"page" parameter must be an integer'))

# Update ordering in the context
query = logic.get_action('related_list')(context,data_dict)
Expand Down Expand Up @@ -67,12 +67,12 @@ def read(self, id):
try:
logic.check_access('related_show', context, data_dict)
except logic.NotAuthorized:
abort(401, _('Not authorized to see this page'))
base.abort(401, _('Not authorized to see this page'))

related = model.Session.query(model.Related).\
filter(model.Related.id == id).first()
if not related:
abort(404, _('The requested related item was not found'))
base.abort(404, _('The requested related item was not found'))

related.view_count = model.Related.view_count + 1

Expand Down

0 comments on commit 3e65478

Please sign in to comment.