Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Sharing: Don't include user message when formatting strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lee committed May 26, 2015
1 parent 93495a5 commit bad2747
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions r2/r2/controllers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ def POST_share(self, shareform, jquery, emails, link, share_from, reply_to,
url_parser.update_query(ref_source="pm")
pm_source_url = url_parser.unparse()

message += '\n%(source_url)s\n\n'
message_body = '\n%(source_url)s\n\n'

# Deliberately not translating this, as it'd be in the
# sender's language
Expand All @@ -1977,9 +1977,9 @@ def POST_share(self, shareform, jquery, emails, link, share_from, reply_to,
count = ("There is currently %(num_comments)s " +
"comment on this link. You can view it here:")
numcom = count % {'num_comments': link.num_comments}
message = message + "%s\n\n" % numcom
message_body = message_body + "%s\n\n" % numcom
else:
message = message + "You can leave a comment here:\n\n"
message_body = message_body + "You can leave a comment here:\n\n"

url = add_sr(link.make_permalink_slow(), force_hostname=True)
url_parser = UrlParser(url)
Expand All @@ -1988,12 +1988,12 @@ def POST_share(self, shareform, jquery, emails, link, share_from, reply_to,
url_parser.update_query(ref_source="pm")
pm_comments_url = url_parser.unparse()

message += '%(comments_url)s'
email_message = message % {
message_body += '%(comments_url)s'
email_message = message + message_body % {
"source_url": email_source_url,
"comments_url": email_comments_url,
}
pm_message = message % {
pm_message = message + message_body % {
"source_url": pm_source_url,
"comments_url": pm_comments_url,
}
Expand Down

0 comments on commit bad2747

Please sign in to comment.