From: Eevee Date: Sun, 15 Aug 2010 03:54:35 +0000 (-0700) Subject: Crash fix: /forums/999999 would crash instead of 404. X-Git-Tag: veekun-promotions/2010082201~2 X-Git-Url: http://git.veekun.com/zzz-spline-forum.git/commitdiff_plain/34407a4a6052d7afa50caf0bcd6a8e6b55eb93a0?hp=ada04281f0d79218f32415acf570a627dc68bde7 Crash fix: /forums/999999 would crash instead of 404. --- diff --git a/splinext/forum/controllers/forum.py b/splinext/forum/controllers/forum.py index 342e8e6..2e94f6a 100644 --- a/splinext/forum/controllers/forum.py +++ b/splinext/forum/controllers/forum.py @@ -29,9 +29,8 @@ class ForumController(BaseController): return render('/forum/forums.mako') def threads(self, forum_id): - try: - c.forum = meta.Session.query(forum_model.Forum).get(forum_id) - except NoResultFound: + c.forum = meta.Session.query(forum_model.Forum).get(forum_id) + if not c.forum: abort(404) c.write_thread_form = WriteThreadForm()