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
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

View File

@ -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,