Cleaning up, adding tokens
Doing some token based temporary flattening for django
This commit is contained in:
parent
7b86cf726d
commit
4e948788d7
|
@ -50,5 +50,5 @@ def unmaketree(tree):
|
|||
yield from unmaketree(children)
|
||||
yield OUT
|
||||
|
||||
def threadtree(descendants):
|
||||
def build(descendants):
|
||||
return unmaketree(maketree(descendants))
|
||||
|
|
|
@ -671,6 +671,7 @@ def note(request, next=None, prev=None):
|
|||
},
|
||||
)
|
||||
|
||||
import threadtree
|
||||
|
||||
@br_login_required
|
||||
def thread(request, id):
|
||||
|
@ -687,10 +688,6 @@ def thread(request, id):
|
|||
notifications = _notes_count(account, mastodon)
|
||||
filters = get_filters(mastodon, context="thread")
|
||||
|
||||
import pprint
|
||||
pprint.pprint(context)
|
||||
raise SystemExit(23)
|
||||
|
||||
# Apply filters
|
||||
descendants = [
|
||||
x for x in context.descendants if not toot_matches_filters(x, filters)
|
||||
|
@ -703,10 +700,12 @@ def thread(request, id):
|
|||
"context": context,
|
||||
"toot": toot,
|
||||
"root": root,
|
||||
"descendants": unmaketree(maketree(descendants)),
|
||||
"posts": threadtree.build(descendants)),
|
||||
"own_acct": request.session["active_user"],
|
||||
"notifications": notifications,
|
||||
"preferences": account.preferences,
|
||||
"IN": threadtree.IN,
|
||||
"OUT": threadtree.OUT,
|
||||
},
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue