Adding an outer IN/OUT

If we have multiple roots ever, we need the whole thing in a big <ul></ul>
This commit is contained in:
Cy 2020-06-01 01:48:51 +00:00 committed by Cy
parent 2c8cdac15e
commit 2308d65ec2
2 changed files with 4 additions and 3 deletions

View File

@ -5,7 +5,6 @@ def maketree(descendants):
replies = {}
roots = set()
for descendant in descendants:
pprint(descendant)
if not descendant.in_reply_to_id:
roots.add(descendant.id)
if descendant.in_reply_to_id in replies:
@ -54,4 +53,6 @@ def unmaketree(tree):
yield OUT
def build(descendants):
return unmaketree(maketree(descendants))
yield IN
yield from unmaketree(maketree(descendants))
yield OUT

View File

@ -700,7 +700,7 @@ def thread(request, id):
"context": context,
"toot": toot,
"root": root,
"posts": threadtree.build(descendants),
"posts": tuple(threadtree.build(descendants)),
"own_acct": request.session["active_user"],
"notifications": notifications,
"preferences": account.preferences,