JSON: add link_url to comments on profile pages

Adds the ability to get the original url of a link from within a comment
comment object in the JSON response
This commit is contained in:
feras
2014-02-21 19:50:28 -08:00
committed by Chad Birch
parent 9160aa6341
commit 2d213d201e

View File

@@ -540,6 +540,11 @@ class CommentJsonTemplate(ThingJsonTemplate):
if c.profilepage:
d['link_title'] = thing.link.title
d['link_author'] = thing.link_author.name
if thing.link.is_self:
d['link_url'] = thing.link.make_permalink(thing.subreddit,
force_domain=True)
else:
d['link_url'] = thing.link.url
return d
def rendered_data(self, wrapped):