From e424765fc42bad1d4c88097e573b941d979ba011 Mon Sep 17 00:00:00 2001 From: autocommit Date: Mon, 1 Jun 2020 02:34:15 +0000 Subject: [PATCH] Consistent naming Right, I forgot I was in the middle of changing the name post to toot. Thus explaining why op.post had an empty result, since op.toot was what I changed. --- brutaldon/threadtree.py | 16 ++++++++-------- brutaldon/views.py | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/brutaldon/threadtree.py b/brutaldon/threadtree.py index f4da6db..fe49144 100644 --- a/brutaldon/threadtree.py +++ b/brutaldon/threadtree.py @@ -51,14 +51,14 @@ def maketree(mastodon, descendants): IN = 0 OUT = 1 -class POST: - post = None - def __init__(self, post): - self.post = post +class TOOT: + toot = None + def __init__(self, toot): + self.toot = toot def unmaketree(tree): - for post, children in tree: - yield POST(post) + for toot, children in tree: + yield TOOT(toot) if children: yield IN yield from unmaketree(children) @@ -71,6 +71,6 @@ def build(mastodon, descendants): yield OUT yield IN leftover = tuple(leftover()) - for post in leftover: - yield POST(post) + for toot in leftover: + yield TOOT(toot) yield OUT diff --git a/brutaldon/views.py b/brutaldon/views.py index 758ffdd..c25b7e2 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -692,7 +692,7 @@ def thread(request, id): # descendants = [ # x for x in context.descendants if not toot_matches_filters(x, filters) # ] - posts = tuple(threadtree.build(mastodon, context.descendants)) + toots = tuple(threadtree.build(mastodon, context.descendants)) return render( request, "main/thread.html", @@ -700,7 +700,7 @@ def thread(request, id): "context": context, "toot": toot, "root": root, - "posts": posts, + "toots": toots, "own_acct": request.session["active_user"], "notifications": notifications, "preferences": account.preferences,