Skip to content

Commit 090c221

Browse files
author
Richard Jones
committed
catch bad classname in URL (related to [SF#1240541])
1 parent 80ac876 commit 090c221

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Fixed:
6262
- fix permission check on RetireAction (sf bug 1407342)
6363
- timezone now applied to date for pretty-format (sf bug 1406861)
6464
- fix mangling of "_" in mail Subject class name (sf bug 1413852)
65+
- catch bad classname in URL (related to sf bug 1240541)
6566

6667

6768
2005-10-07 0.8.5

roundup/cgi/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.218 2006-01-09 09:14:27 a1s Exp $
1+
# $Id: client.py,v 1.219 2006-01-25 02:59:27 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -591,7 +591,11 @@ def determine_context(self, dre=re.compile(r'([^\d]+)0*(\d+)')):
591591
if m:
592592
self.classname = m.group(1)
593593
self.nodeid = m.group(2)
594-
if not self.db.getclass(self.classname).hasnode(self.nodeid):
594+
try:
595+
klass = self.db.getclass(self.classname)
596+
except KeyError:
597+
raise NotFound, '%s/%s'%(self.classname, self.nodeid)
598+
if not klass.hasnode(self.nodeid):
595599
raise NotFound, '%s/%s'%(self.classname, self.nodeid)
596600
# with a designator, we default to item view
597601
self.template = 'item'

0 commit comments

Comments
 (0)