changeset 4291:b1772fdb09d0

Fix traceback on .../msgN/ url... ...this requests the file content and for apache mod_wsgi produced a traceback because the mime type is None for messages, fixes issue2550586, thanks to ThomasAH for reporting and to Intevation for funding the fix.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Mon, 30 Nov 2009 21:55:59 +0000
parents 236939e4137b
children 859ab007829f
files CHANGES.txt roundup/cgi/client.py
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Mon Nov 30 21:17:14 2009 +0000
+++ b/CHANGES.txt	Mon Nov 30 21:55:59 2009 +0000
@@ -21,6 +21,10 @@
   sent via email. We now check that user has permission on the message
   content and files properties. Thanks to Intevation for funding this
   fix.
+- Fix traceback on .../msgN/ url, this requests the file content and for
+  apache mod_wsgi produced a traceback because the mime type is None for
+  messages, fixes issue2550586, thanks to ThomasAH for reporting and to
+  Intevation for funding the fix.
 
 
 2009-10-09 1.4.10 (r4374)
--- a/roundup/cgi/client.py	Mon Nov 30 21:17:14 2009 +0000
+++ b/roundup/cgi/client.py	Mon Nov 30 21:55:59 2009 +0000
@@ -880,6 +880,9 @@
                 "this file.")
 
         mime_type = klass.get(nodeid, 'type')
+        # Can happen for msg class:
+        if not mime_type:
+            mime_type = 'text/plain'
 
         # if the mime_type is HTML-ish then make sure we're allowed to serve up
         # HTML-ish content

Roundup Issue Tracker: http://roundup-tracker.org/