aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/views.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-05-10 16:33:52 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-05-10 16:33:52 -0500
commit94fadafe0908e497b9562f6e2689d83d07c5147d (patch)
treea7d0b33e7e99139fda43f151dae3d9702a957383 /mediagoblin/user_pages/views.py
parent0dfa20c984c9e60b02ea9d68db179109028cbe2b (diff)
parent99338b6a6419e6d8c044b82b2dd398a435e477f0 (diff)
downloadmediagoblin-94fadafe0908e497b9562f6e2689d83d07c5147d.tar.lz
mediagoblin-94fadafe0908e497b9562f6e2689d83d07c5147d.tar.xz
mediagoblin-94fadafe0908e497b9562f6e2689d83d07c5147d.zip
Merge remote-tracking branch 'refs/remotes/dthompson/453_disable_comments'
Diffstat (limited to 'mediagoblin/user_pages/views.py')
-rw-r--r--mediagoblin/user_pages/views.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 52745be2..738cc054 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -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,