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:
parent
1a3cc90c85
commit
e424765fc4
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue