Fix errors in collection views

When a collection does not exist, render the 404 page.
This commit is contained in:
Joar Wandborg 2013-02-18 14:41:34 +01:00
parent ab9b0b4175
commit 61e39d90e5

View File

@ -309,6 +309,9 @@ def user_collection(request, page, url_user=None):
get_creator=url_user,
slug=request.matchdict['collection']).first()
if not collection:
return render_404(request)
cursor = collection.get_collection_items()
pagination = Pagination(page, cursor)
@ -515,6 +518,8 @@ def collection_atom_feed(request):
collection = Collection.query.filter_by(
creator=user.id,
slug=request.matchdict['collection']).first()
if not collection:
return render_404(request)
cursor = CollectionItem.query.filter_by(
collection=collection.id) \