Added a check to prevent blank messages from being posted.

This commit is contained in:
Aaron Williamson 2011-10-03 21:03:36 -04:00
parent 4d7a93a493
commit 7298ffa11b

View File

@ -133,9 +133,14 @@ def media_post_comment(request):
comment['media_entry'] = ObjectId(request.matchdict['media'])
comment['author'] = request.user['_id']
comment['content'] = unicode(request.POST['comment_content'])
comment['content_html'] = cleaned_markdown_conversion(comment['content'])
if not comment['content'].strip():
messages.add_message(
request,
messages.ERROR,
_("Empty comments are not allowed."))
else:
comment.save()
messages.add_message(