Merge remote-tracking branch 'refs/remotes/dthompson/453_disable_comments'

This commit is contained in:
Christopher Allan Webber
2013-05-10 16:33:52 -05:00
3 changed files with 18 additions and 7 deletions

View File

@@ -161,7 +161,13 @@ def media_post_comment(request, media):
comment.author = request.user.id
comment.content = unicode(request.form['comment_content'])
if not comment.content.strip():
# Show error message if commenting is disabled.
if not mg_globals.app_config['allow_comments']:
messages.add_message(
request,
messages.ERROR,
_("Sorry, comments are disabled."))
elif not comment.content.strip():
messages.add_message(
request,
messages.ERROR,