Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 1992:78267a673131 maint-0.6
merge from HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 21 Jan 2004 04:54:27 +0000 |
| parents | d773a3849139 |
| children | 88291693df3a |
line wrap: on
line diff
--- a/roundup/cgi/client.py Tue Jan 20 20:36:55 2004 +0000 +++ b/roundup/cgi/client.py Wed Jan 21 04:54:27 2004 +0000 @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.130.2.6 2004-01-17 02:48:00 richard Exp $ +# $Id: client.py,v 1.130.2.7 2004-01-21 04:54:27 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -1866,8 +1866,11 @@ props['name'] = fn # use this info as the type/filename properties if propdef.has_key('type'): - props['type'] = mimetypes.guess_type(fn)[0] - if not props['type']: + if hasattr(value, 'type') and value.type: + props['type'] = value.type + elif mimetypes.guess_type(fn)[0]: + props['type'] = mimetypes.guess_type(fn)[0] + else: props['type'] = "application/octet-stream" # finally, read the content value = value.value
