Skip to content

Commit 856804e

Browse files
author
Richard Jones
committed
handle "classname" URL path errors cleaner (generate a 404)
1 parent f762aa3 commit 856804e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ are given with the most recent entry first.
44
2002-10-?? 0.5.2
55
- added quotes around python interpreter in windows bat (sf bug 623963)
66
- fixed link at end of installation doc (sf bug 623957)
7+
- handle "classname" URL path errors cleaner (generate a 404)
78

89

910
2002-10-16 0.5.1

roundup/cgi/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.53 2002-10-15 06:37:21 richard Exp $
1+
# $Id: client.py,v 1.54 2002-10-17 06:11:25 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -313,6 +313,12 @@ def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')):
313313
# with only a class, we default to index view
314314
self.template = 'index'
315315

316+
# make sure the classname is valid
317+
try:
318+
self.db.getclass(self.classname)
319+
except KeyError:
320+
raise NotFound, self.classname
321+
316322
# see if we have a template override
317323
if self.form.has_key(':template'):
318324
self.template = self.form[':template'].value

0 commit comments

Comments
 (0)