mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-30 01:08:32 -05:00
Add distinguished status to JSON templates
This commit is contained in:
@@ -185,6 +185,12 @@ class ThingJsonTemplate(JsonTemplate):
|
||||
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 =
|
||||
|
||||
Reference in New Issue
Block a user