--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -148,17 +148,13 @@
file_info = kwargs.pop('file_info', None)
if file_info is not None:
text = "%s\n\n\nAttachment:" % text
- if isinstance(file_info, list):
- for attach in file_info:
- attach.file.seek(0, 2)
- bytecount = attach.file.tell()
- attach.file.seek(0)
- text = "%s %s (%s; %s) " % (text, attach.filename, h.do_filesizeformat(bytecount), attach.type)
- else:
- file_info.file.seek(0, 2)
- bytecount = file_info.file.tell()
- file_info.file.seek(0)
- text = "%s %s (%s; %s) " % (text, file_info.filename, h.do_filesizeformat(bytecount), file_info.type)
+ if not isinstance(file_info, list):
+ file_info = [file_info]
+ for attach in file_info:
+ attach.file.seek(0, 2)
+ bytecount = attach.file.tell()
+ attach.file.seek(0)
+ text = "%s %s (%s; %s) " % (text, attach.filename, h.do_filesizeformat(bytecount), attach.type)
subject = post.subject or ''
if post.parent_id and not subject.lower().startswith('re:'):