mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 15:23:52 -05:00
Fix a crash on threads with filters
This commit is contained in:
parent
0007547a7c
commit
b06c664cd5
@ -18,15 +18,15 @@ mastodon.status_context(<numerical id>)
|
|||||||
<h1 id="title" class="title">
|
<h1 id="title" class="title">
|
||||||
Thread
|
Thread
|
||||||
</h1>
|
</h1>
|
||||||
{% for ancestor in context.ancestors %}
|
{% for ancestor in ancestors %}
|
||||||
{% include "main/toot_partial.html" with toot=ancestor %}
|
{% include "main/toot_partial.html" with toot=ancestor %}
|
||||||
<hr class="is-hidden">
|
<hr class="is-hidden">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% include "main/toot_partial.html" with toot=toot active=True %}
|
{% include "main/toot_partial.html" with toot=toot active=True %}
|
||||||
<hr class="is-hidden">
|
<hr class="is-hidden">
|
||||||
{% for descendant in context.descendants %}
|
{% for descendant in descendants %}
|
||||||
{% include "main/toot_partial.html" with toot=descendant %}
|
{% include "main/toot_partial.html" with toot=descendant %}
|
||||||
<hr class="is-hidden">
|
<hr class="is-hidden">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if not preferences.no_javascript %}
|
{% if not preferences.no_javascript %}
|
||||||
|
@ -425,12 +425,14 @@ def thread(request, id):
|
|||||||
filters = get_filters(mastodon, context='thread')
|
filters = get_filters(mastodon, context='thread')
|
||||||
|
|
||||||
# Apply filters
|
# Apply filters
|
||||||
context.ancestors = [x for x in context.ancestors if not toot_matches_filters(x, filters)]
|
ancestors = [x for x in context.ancestors if not toot_matches_filters(x, filters)]
|
||||||
context.descendants = [x for x in context.descendants if not toot_matches_filters(x, filters)]
|
descendants = [x for x in context.descendants if not toot_matches_filters(x, filters)]
|
||||||
|
|
||||||
|
|
||||||
return render(request, 'main/thread.html',
|
return render(request, 'main/thread.html',
|
||||||
{'context': context, 'toot': toot,
|
{'context': context, 'toot': toot,
|
||||||
|
'ancestors': ancestors,
|
||||||
|
'descendants': descendants,
|
||||||
'own_acct': request.session['user'],
|
'own_acct': request.session['user'],
|
||||||
'notifications': notifications,
|
'notifications': notifications,
|
||||||
'preferences': account.preferences})
|
'preferences': account.preferences})
|
||||||
|
Loading…
Reference in New Issue
Block a user