|
a/Allura/allura/controllers/discuss.py |
|
b/Allura/allura/controllers/discuss.py |
|
... |
|
... |
146 |
@expose()
|
146 |
@expose()
|
147 |
@validate(pass_validator, error_handler=index)
|
147 |
@validate(pass_validator, error_handler=index)
|
148 |
def post(self, **kw):
|
148 |
def post(self, **kw):
|
149 |
require(has_artifact_access('post', self.thread))
|
149 |
require(has_artifact_access('post', self.thread))
|
150 |
kw = self.W.edit_post.to_python(kw, None)
|
150 |
kw = self.W.edit_post.to_python(kw, None)
|
|
|
151 |
if not kw['text']:
|
|
|
152 |
flash('Your post was not saved. You must provide content.', 'error')
|
|
|
153 |
redirect(request.referer)
|
151 |
file_info = kw.pop('file_info', None)
|
154 |
file_info = kw.pop('file_info', None)
|
152 |
p = self.thread.add_post(**kw)
|
155 |
p = self.thread.add_post(**kw)
|
153 |
if hasattr(file_info, 'file'):
|
156 |
if hasattr(file_info, 'file'):
|
154 |
p.attach(
|
157 |
p.attach(
|
155 |
file_info.filename, file_info.file, content_type=file_info.type,
|
158 |
file_info.filename, file_info.file, content_type=file_info.type,
|