|
a/Allura/allura/controllers/discuss.py |
|
b/Allura/allura/controllers/discuss.py |
|
... |
|
... |
181 |
require_access(self.thread, 'post')
|
181 |
require_access(self.thread, 'post')
|
182 |
kw = self.W.edit_post.to_python(kw, None)
|
182 |
kw = self.W.edit_post.to_python(kw, None)
|
183 |
if not kw['text']:
|
183 |
if not kw['text']:
|
184 |
flash('Your post was not saved. You must provide content.', 'error')
|
184 |
flash('Your post was not saved. You must provide content.', 'error')
|
185 |
redirect(request.referer)
|
185 |
redirect(request.referer)
|
186 |
file_info = kw.pop('file_info', None)
|
186 |
file_info = kw.get('file_info', None)
|
187 |
p = self.thread.add_post(**kw)
|
187 |
p = self.thread.add_post(**kw)
|
188 |
if hasattr(file_info, 'file'):
|
188 |
if hasattr(file_info, 'file'):
|
189 |
p.attach(
|
189 |
p.attach(
|
190 |
file_info.filename, file_info.file, content_type=file_info.type,
|
190 |
file_info.filename, file_info.file, content_type=file_info.type,
|
191 |
post_id=p._id,
|
191 |
post_id=p._id,
|