diff options
author | Sebastian Silva <sebastian@somosazucar.org> | 2013-04-25 07:54:34 (GMT) |
---|---|---|
committer | Sebastian Silva <sebastian@somosazucar.org> | 2013-04-25 07:54:34 (GMT) |
commit | 52ab3a686ba516b53d2f0184779a2ff012030737 (patch) | |
tree | 6ac2eca1938125ce3d190623e743d128a185f441 | |
parent | 712db13f38e090e2a5fb1b11b03b9af33f90202e (diff) |
Reduce resource list items to 3
-rw-r--r-- | sugar_network_webui/app.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sugar_network_webui/app.py b/sugar_network_webui/app.py index a89e810..d8496ee 100644 --- a/sugar_network_webui/app.py +++ b/sugar_network_webui/app.py @@ -450,7 +450,7 @@ def resource_list(query=None): try: r, total_pages, total, info = paginate(resource_object, - query, page=page, _PAGE_SIZE=4) + query, page=page, _PAGE_SIZE=3) except KeyError: return redirect(url_for('context_resource_browser', context_guid=context_guid, page=1)) @@ -636,7 +636,10 @@ def reload(href=None): def reviews_browser(resource_guid=None, review_guid=None): if review_guid: r = g.client.Review(guid=review_guid, reply=['context']) - resource_guid = r['context'] + try: + resource_guid = r['context'] + except NotFound: + abort(404) return redirect('/context/reviews/' + resource_guid) g.Reviews.filter(context=resource_guid) @@ -741,7 +744,7 @@ def context_resource_browser(context_guid=None, query=None): try: r, total_pages, total, info = paginate(resource_object, - query, page=page, _PAGE_SIZE=4, context=context_guid) + query, page=page, _PAGE_SIZE=3, context=context_guid) except KeyError: return redirect(url_for('context_resource_browser', context_guid=context_guid, page=1)) |