mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Fix subreddit names in ModAction json output
The sr_id36 field is working for viewing a json version of the mod log, but the subreddit name field was null. This adds the subreddit name back in.
This commit is contained in:
@@ -1460,7 +1460,7 @@ class ModActionTemplate(ThingJsonTemplate):
|
||||
mod='moderator',
|
||||
mod_id36='mod_id36',
|
||||
sr_id36='sr_id36',
|
||||
subreddit='sr_name',
|
||||
subreddit='subreddit',
|
||||
target_author='target_author',
|
||||
target_fullname='target_fullname',
|
||||
target_permalink='target_permalink',
|
||||
@@ -1483,6 +1483,8 @@ class ModActionTemplate(ThingJsonTemplate):
|
||||
return None
|
||||
elif attr == "moderator":
|
||||
return thing.moderator.name
|
||||
elif attr == "subreddit":
|
||||
return thing.subreddit.name
|
||||
|
||||
return ThingJsonTemplate.thing_attr(self, thing, attr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user