Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 1288:ad8de51d7cd5
handle "classname" URL path errors cleaner (generate a 404)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 17 Oct 2002 06:11:25 +0000 |
| parents | a9a3c378acc2 |
| children | bf8b2380adb3 |
line wrap: on
line diff
--- a/roundup/cgi/client.py Thu Oct 17 00:22:16 2002 +0000 +++ b/roundup/cgi/client.py Thu Oct 17 06:11:25 2002 +0000 @@ -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 @@ # 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
