From: richard Date: Thu, 17 Oct 2002 06:11:25 +0000 (+0000) Subject: handle "classname" URL path errors cleaner (generate a 404) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e6fd776ddbcddd7f6acf098b8b4cfa715c9a0644;p=roundup.git handle "classname" URL path errors cleaner (generate a 404) git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1362 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index 99d5253..55a89b7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,7 @@ are given with the most recent entry first. 2002-10-?? 0.5.2 - added quotes around python interpreter in windows bat (sf bug 623963) - fixed link at end of installation doc (sf bug 623957) +- handle "classname" URL path errors cleaner (generate a 404) 2002-10-16 0.5.1 diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index c01fc99..03eaf11 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.53 2002-10-15 06:37:21 richard Exp $ +# $Id: client.py,v 1.54 2002-10-17 06:11:25 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -313,6 +313,12 @@ class Client: # with only a class, we default to index view self.template = 'index' + # make sure the classname is valid + try: + self.db.getclass(self.classname) + except KeyError: + raise NotFound, self.classname + # see if we have a template override if self.form.has_key(':template'): self.template = self.form[':template'].value