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:
MelissaCole
2015-12-14 17:40:33 -08:00
parent 8feb5764ca
commit 77c0c49d47

View File

@@ -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)