Debugging a lookup error

It was saying stuff was unhashable, but I thought I was just hashing by post ID.
This commit is contained in:
autocommit 2020-06-01 01:42:31 +00:00 committed by Cy
parent 11546907a6
commit 4e7395babe
No known key found for this signature in database
GPG Key ID: F66D599380F88521
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,10 @@
def maketree(descendants):
lookup = {(descendant.id, descendant) for descendant in descendants}
try:
lookup = {(descendant.id, descendant) for descendant in descendants}
except:
from pprint import pprint
pprint(lookup)
raise
replies = {}
roots = set()
for descendant in descendants:

View File

@ -671,7 +671,7 @@ def note(request, next=None, prev=None):
},
)
import threadtree
from . import threadtree
@br_login_required
def thread(request, id):
@ -700,7 +700,7 @@ def thread(request, id):
"context": context,
"toot": toot,
"root": root,
"posts": threadtree.build(descendants)),
"posts": threadtree.build(descendants),
"own_acct": request.session["active_user"],
"notifications": notifications,
"preferences": account.preferences,