Crash fix: /forums/999999 would crash instead of 404.
authorEevee <git@veekun.com>
Sun, 15 Aug 2010 03:54:35 +0000 (20:54 -0700)
committerEevee <git@veekun.com>
Sun, 15 Aug 2010 03:54:35 +0000 (20:54 -0700)
splinext/forum/controllers/forum.py

index 342e8e6..2e94f6a 100644 (file)
@@ -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()