aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/user_pages/views.py')
-rw-r--r--mediagoblin/user_pages/views.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index a028c305..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,
@@ -522,9 +528,7 @@ def collection_atom_feed(request):
ATOM feed id is a tag URI (see http://en.wikipedia.org/wiki/Tag_URI)
"""
atomlinks = [{
- 'href': request.urlgen(
- 'mediagoblin.user_pages.user_collection',
- qualified=True, user=request.matchdict['user'], collection=collection.slug),
+ 'href': collection.url_for_self(request.urlgen, qualified=True),
'rel': 'alternate',
'type': 'text/html'
}]