summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c6fd470)
raw | patch | inline | side by side (parent: c6fd470)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 15 Jan 2004 00:01:15 +0000 (00:01 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 15 Jan 2004 00:01:15 +0000 (00:01 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2035 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi/client.py | patch | blob | history |
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index fe8831371b8590243b153b644e93d7bd4bef0411..5929d92698d268199d02ed3cbcd7ac35a46e2c64 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.149 2003-12-05 03:28:38 richard Exp $
+# $Id: client.py,v 1.150 2004-01-15 00:01:15 richard Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
if not m:
raise NotFound, str(designator)
classname, nodeid = m.group(1), m.group(2)
- if classname != 'file':
- raise NotFound, designator
self.opendb('admin')
- file = self.db.file
+ klass = self.db.getclass(classname)
+
+ # make sure we have the appropriate properties
+ props = klass.getprops()
+ if not pops.has_key('type'):
+ raise NotFound, designator
+ if not pops.has_key('content'):
+ raise NotFound, designator
- mime_type = file.get(nodeid, 'type')
- content = file.get(nodeid, 'content')
- lmt = file.get(nodeid, 'activity').timestamp()
+ mime_type = klass.get(nodeid, 'type')
+ content = klass.get(nodeid, 'content')
+ lmt = klass.get(nodeid, 'activity').timestamp()
self._serve_file(lmt, mime_type, content)
}
try:
# let the template render figure stuff out
- return pt.render(self, None, None, **args)
+ result = pt.render(self, None, None, **args)
+ self.additional_headers['Content-Type'] = pt.content_type
+ return result
except NoTemplate, message:
return '<strong>%s</strong>'%message
except: