aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/lib.py
diff options
context:
space:
mode:
authorDerek Moore <derek.k.moore@gmail.com>2012-03-25 22:25:54 -0700
committerDerek Moore <derek.k.moore@gmail.com>2012-03-25 22:25:54 -0700
commitfa72e516897a370b1e47e5f0ff17155990cd2414 (patch)
tree364b9081f4df5f55ca414eddbc3dd2c7eb5ec333 /mediagoblin/user_pages/lib.py
parent94e605237512daa518bcab9b59edbc1107840006 (diff)
downloadmediagoblin-fa72e516897a370b1e47e5f0ff17155990cd2414.tar.lz
mediagoblin-fa72e516897a370b1e47e5f0ff17155990cd2414.tar.xz
mediagoblin-fa72e516897a370b1e47e5f0ff17155990cd2414.zip
Updates to send email comments, included translation, better validation.
Diffstat (limited to 'mediagoblin/user_pages/lib.py')
-rw-r--r--mediagoblin/user_pages/lib.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/mediagoblin/user_pages/lib.py b/mediagoblin/user_pages/lib.py
index 00091d7a..79f9a2b2 100644
--- a/mediagoblin/user_pages/lib.py
+++ b/mediagoblin/user_pages/lib.py
@@ -16,6 +16,7 @@
from mediagoblin.tools.mail import send_email
from mediagoblin.tools.template import render_template
+from mediagoblin.tools.translate import pass_to_ugettext as _
from mediagoblin import mg_globals
def send_comment_email(user, comment, media, request):
@@ -29,13 +30,12 @@ def send_comment_email(user, comment, media, request):
- request: the request
"""
- comment_url = u'http://{host}{comment_uri}'.format(
- host=request.host,
- comment_uri=request.urlgen(
- 'mediagoblin.user_pages.media_home.view_comment',
- comment = comment._id,
- user = media.get_uploader.username,
- media = media.slug_or_id) + '#comment')
+ comment_url = request.urlgen(
+ 'mediagoblin.user_pages.media_home.view_comment',
+ comment = comment._id,
+ user = media.get_uploader.username,
+ media = media.slug_or_id,
+ qualified = True) + '#comment'
comment_author = comment.get_author['username']
@@ -49,6 +49,6 @@ def send_comment_email(user, comment, media, request):
send_email(
mg_globals.app_config['email_sender_address'],
[user.email],
- 'GNU MediaGoblin - {comment_author} commented on your post'.format(
- comment_author=comment_author),
+ 'GNU MediaGoblin - {comment_author} '.format(
+ comment_author=comment_author) + _('commented on your post'),
rendered_email)