Permalink
Browse files

Add distinguished status to JSON templates

  • Loading branch information...
1 parent 191c249 commit c870dde2760f147bfc58c43a8b3e4da71d793df0 @Deimos Deimos committed Feb 26, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 r2/r2/lib/jsontemplates.py
@@ -185,6 +185,12 @@ def thing_attr(self, thing, attr):
elif attr == "child":
return CachedVariable("childlisting")
+ if attr == 'distinguished':
+ distinguished = getattr(thing, attr, 'no')
+ if distinguished == 'no':
+ return None
+ return distinguished
+
if attr in ["num_reports", "banned_by", "approved_by"]:
if c.user_is_loggedin and thing.subreddit.is_moderator(c.user):
if attr == "num_reports":
@@ -306,6 +312,7 @@ class LinkJsonTemplate(ThingJsonTemplate):
media_embed = "media_embed",
selftext = "selftext",
selftext_html= "selftext_html",
+ distinguished= "distinguished",
num_comments = "num_comments",
num_reports = "num_reports",
banned_by = "banned_by",
@@ -364,6 +371,7 @@ class CommentJsonTemplate(ThingJsonTemplate):
replies = "child",
body = "body",
body_html = "body_html",
+ distinguished= "distinguished",
likes = "likes",
author = "author",
author_flair_text =

0 comments on commit c870dde

Please sign in to comment.