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.
This commit is contained in:
Cy 2020-06-01 02:34:15 +00:00 committed by Cy
parent 8cda9227b9
commit 5187715244
2 changed files with 10 additions and 10 deletions

View File

@ -51,14 +51,14 @@ def maketree(mastodon, descendants):
IN = 0 IN = 0
OUT = 1 OUT = 1
class POST: class TOOT:
post = None toot = None
def __init__(self, post): def __init__(self, toot):
self.post = post self.toot = toot
def unmaketree(tree): def unmaketree(tree):
for post, children in tree: for toot, children in tree:
yield POST(post) yield TOOT(toot)
if children: if children:
yield IN yield IN
yield from unmaketree(children) yield from unmaketree(children)
@ -71,6 +71,6 @@ def build(mastodon, descendants):
yield OUT yield OUT
yield IN yield IN
leftover = tuple(leftover()) leftover = tuple(leftover())
for post in leftover: for toot in leftover:
yield POST(post) yield TOOT(toot)
yield OUT yield OUT

View File

@ -692,7 +692,7 @@ def thread(request, id):
# descendants = [ # descendants = [
# x for x in context.descendants if not toot_matches_filters(x, filters) # 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( return render(
request, request,
"main/thread.html", "main/thread.html",
@ -700,7 +700,7 @@ def thread(request, id):
"context": context, "context": context,
"toot": toot, "toot": toot,
"root": root, "root": root,
"posts": posts, "toots": toots,
"own_acct": request.session["active_user"], "own_acct": request.session["active_user"],
"notifications": notifications, "notifications": notifications,
"preferences": account.preferences, "preferences": account.preferences,