Cleaning up, adding tokens

Doing some token based temporary flattening for django
This commit is contained in:
autocommit 2020-06-01 01:41:13 +00:00 committed by Cy
parent 8eea5b05b1
commit 11546907a6
No known key found for this signature in database
GPG Key ID: F66D599380F88521
2 changed files with 5 additions and 6 deletions

View File

@ -50,5 +50,5 @@ def unmaketree(tree):
yield from unmaketree(children)
yield OUT
def threadtree(descendants):
def build(descendants):
return unmaketree(maketree(descendants))

View File

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