|
a/Allura/allura/model/notification.py |
|
b/Allura/allura/model/notification.py |
|
... |
|
... |
146 |
post = kwargs.pop('post')
|
146 |
post = kwargs.pop('post')
|
147 |
text = post.text
|
147 |
text = post.text
|
148 |
file_info = kwargs.pop('file_info', None)
|
148 |
file_info = kwargs.pop('file_info', None)
|
149 |
if file_info is not None:
|
149 |
if file_info is not None:
|
150 |
text = "%s\n\n\nAttachment:" % text
|
150 |
text = "%s\n\n\nAttachment:" % text
|
151 |
if isinstance(file_info, list):
|
151 |
if not isinstance(file_info, list):
|
|
|
152 |
file_info = [file_info]
|
152 |
for attach in file_info:
|
153 |
for attach in file_info:
|
153 |
attach.file.seek(0, 2)
|
154 |
attach.file.seek(0, 2)
|
154 |
bytecount = attach.file.tell()
|
155 |
bytecount = attach.file.tell()
|
155 |
attach.file.seek(0)
|
156 |
attach.file.seek(0)
|
156 |
text = "%s %s (%s; %s) " % (text, attach.filename, h.do_filesizeformat(bytecount), attach.type)
|
157 |
text = "%s %s (%s; %s) " % (text, attach.filename, h.do_filesizeformat(bytecount), attach.type)
|
157 |
else:
|
|
|
158 |
file_info.file.seek(0, 2)
|
|
|
159 |
bytecount = file_info.file.tell()
|
|
|
160 |
file_info.file.seek(0)
|
|
|
161 |
text = "%s %s (%s; %s) " % (text, file_info.filename, h.do_filesizeformat(bytecount), file_info.type)
|
|
|
162 |
|
158 |
|
163 |
subject = post.subject or ''
|
159 |
subject = post.subject or ''
|
164 |
if post.parent_id and not subject.lower().startswith('re:'):
|
160 |
if post.parent_id and not subject.lower().startswith('re:'):
|
165 |
subject = 'Re: ' + subject
|
161 |
subject = 'Re: ' + subject
|
166 |
author = post.author()
|
162 |
author = post.author()
|