Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #126 from rossbruniges/category-500s

Closes #124 - when a category can't be found we now throw a 404
  • Loading branch information...
commit 04f799f7daa7b9259d1de1fcfded06590988f04f 2 parents f91c4fc + 68ce275
@rossbruniges rossbruniges authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 gameon/submissions/views.py
View
6 gameon/submissions/views.py
@@ -84,7 +84,11 @@ def list(request, category='all', template='submissions/list.html'):
page_category = False
else:
entry_set = Entry.objects.filter(category__slug=category).order_by('-pk')
- page_category = Category.objects.get(slug=category)
+ # throwing a 404 is MUCH better than a 500 eh?
+ try:
+ page_category = Category.objects.get(slug=category)
+ except Category.DoesNotExist:
+ raise Http404
submissions = get_paginator(entry_set, page_number)
Please sign in to comment.
Something went wrong with that request. Please try again.