aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin')
-rw-r--r--mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po6
-rw-r--r--mediagoblin/user_pages/views.py15
2 files changed, 15 insertions, 6 deletions
diff --git a/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po b/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po
index 4d178b9c..c6ed08d7 100644
--- a/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po
+++ b/mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po
@@ -480,7 +480,11 @@ msgstr ""
msgid "I am sure I want to delete this"
msgstr ""
-#: mediagoblin/user_pages/views.py:176
+#: mediagoblin/user_pages/views.py:142
+msgid "Empty comments are not allowed."
+msgstr ""
+
+#: mediagoblin/user_pages/views.py:181
msgid "You are about to delete another user's media. Proceed with caution."
msgstr ""
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 9cec74dc..4cd56b75 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -133,14 +133,19 @@ 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'])
- comment.save()
+ if not comment['content'].strip():
+ messages.add_message(
+ request,
+ messages.ERROR,
+ _("Empty comments are not allowed."))
+ else:
+ comment.save()
- messages.add_message(
- request, messages.SUCCESS,
- 'Comment posted!')
+ messages.add_message(
+ request, messages.SUCCESS,
+ _('Comment posted!'))
return redirect(request, 'mediagoblin.user_pages.media_home',
media = request.matchdict['media'],