mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Provide proper thing_id for message parents.
This commit is contained in:
@@ -402,6 +402,7 @@ class MessageJsonTemplate(ThingJsonTemplate):
|
||||
first_message= "first_message")
|
||||
|
||||
def thing_attr(self, thing, attr):
|
||||
from r2.models import Message
|
||||
if attr == "was_comment":
|
||||
return thing.was_comment
|
||||
elif attr == "context":
|
||||
@@ -420,6 +421,9 @@ class MessageJsonTemplate(ThingJsonTemplate):
|
||||
return safemarkdown(thing.body)
|
||||
elif attr == "author" and getattr(thing, "hide_author", False):
|
||||
return None
|
||||
elif attr == "parent_id":
|
||||
if getattr(thing, "parent_id", None):
|
||||
return make_fullname(Message, thing.parent_id)
|
||||
return ThingJsonTemplate.thing_attr(self, thing, attr)
|
||||
|
||||
def rendered_data(self, wrapped):
|
||||
|
||||
Reference in New Issue
Block a user