diff --git a/brutaldon/threadtree.py b/brutaldon/threadtree.py index a429e48..de3669c 100644 --- a/brutaldon/threadtree.py +++ b/brutaldon/threadtree.py @@ -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 diff --git a/brutaldon/views.py b/brutaldon/views.py index f8f55db..ca5e389 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -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,