fix hn self posts related discussion.
This commit is contained in:
parent
abf7f0a802
commit
a86eb98c1a
|
@ -99,8 +99,10 @@ def submit():
|
||||||
def story(sid):
|
def story(sid):
|
||||||
story = database.get_story(sid)
|
story = database.get_story(sid)
|
||||||
if story:
|
if story:
|
||||||
related = database.get_stories_by_url(story.meta['url'])
|
related = []
|
||||||
related = [r.meta for r in related]
|
if story.meta['url']:
|
||||||
|
related = database.get_stories_by_url(story.meta['url'])
|
||||||
|
related = [r.meta for r in related]
|
||||||
res = Response(json.dumps({"story": story.data, "related": related}))
|
res = Response(json.dumps({"story": story.data, "related": related}))
|
||||||
res.headers['content-type'] = 'application/json'
|
res.headers['content-type'] = 'application/json'
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Reference in New Issue
Block a user