Skip to content

Commit d23341e

Browse files
author
Richard Jones
committed
handle the case where there is no file attached
1 parent 6d6e710 commit d23341e

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ Fixed:
3434
. bug #479511 ] mailgw to pop
3535
. bug #479508 ] roundup-admin crash on wrong class
3636
. bad error report in hyperdb
37+
. roundup.mailgw now handles errors on the set() and create() at the end
38+
of processing
39+
. roundup.mailgw also handles messages that are passed to it that don't
40+
contain a From: line - apparently some POP servers can do this. It punts
41+
an error message to the roundup admin.
3742
. fixed nosy reaction and author copy handling
3843
. errors in nosy reaction will be propogated now (were effectively being
3944
squashed)
4045
. re-open the database as the author in mail handling
4146

47+
4248
2001-10-23 - 0.3.0 pre 3
4349
Feature:
4450
. MailGW now moves 'unread' to 'chatting' on receiving e-mail for an issue.

roundup/cgi_client.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.56 2001-11-14 21:35:21 richard Exp $
18+
# $Id: cgi_client.py,v 1.57 2001-11-15 10:24:27 richard Exp $
1919

2020
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
2121
import binascii, Cookie, time
@@ -428,12 +428,13 @@ def _post_editnode(self, nid, changes=None):
428428
files = []
429429
if self.form.has_key('__file'):
430430
file = self.form['__file']
431-
type = mimetypes.guess_type(file.filename)[0]
432-
if not type:
433-
type = "application/octet-stream"
434-
# create the new file entry
435-
files.append(self.db.file.create(type=type, name=file.filename,
436-
content=file.file.read()))
431+
if file.filename:
432+
type = mimetypes.guess_type(file.filename)[0]
433+
if not type:
434+
type = "application/octet-stream"
435+
# create the new file entry
436+
files.append(self.db.file.create(type=type, name=file.filename,
437+
content=file.file.read()))
437438

438439
# generate an edit message
439440
# don't bother if there's no messages or nosy list
@@ -966,6 +967,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
966967

967968
#
968969
# $Log: not supported by cvs2svn $
970+
# Revision 1.56 2001/11/14 21:35:21 richard
971+
# . users may attach files to issues (and support in ext) through the web now
972+
#
969973
# Revision 1.55 2001/11/07 02:34:06 jhermann
970974
# Handling of damaged login cookies
971975
#

roundup/mailgw.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272
an exception, the original message is bounced back to the sender with the
7373
explanatory message given in the exception.
7474
75-
$Id: mailgw.py,v 1.33 2001-11-13 21:44:44 richard Exp $
75+
$Id: mailgw.py,v 1.34 2001-11-15 10:24:27 richard Exp $
7676
'''
7777

7878

@@ -126,7 +126,7 @@ def main(self, fp):
126126
def handle_Message(self, message):
127127
'''Handle an RFC822 Message
128128
129-
Hanle the Message object by calling handle_message() and then cope
129+
Handle the Message object by calling handle_message() and then cope
130130
with any errors raised by handle_message.
131131
This method's job is to make that call and handle any
132132
errors in a sane manner. It should be replaced if you wish to
@@ -521,6 +521,9 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
521521

522522
#
523523
# $Log: not supported by cvs2svn $
524+
# Revision 1.33 2001/11/13 21:44:44 richard
525+
# . re-open the database as the author in mail handling
526+
#
524527
# Revision 1.32 2001/11/12 22:04:29 richard
525528
# oops, left debug in there
526529
#

0 commit comments

Comments
 (0)