Make filtering preference work again
This commit is contained in:
parent
6bb4a428d7
commit
743bdc856c
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.1 on 2018-08-26 23:35
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('brutaldon', '0012_auto_20180826_1853'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='preference',
|
||||||
|
name='theme',
|
||||||
|
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='brutaldon.Theme'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -103,9 +103,9 @@ def timeline(request, timeline='home', timeline_name='Home', max_id=None, since_
|
||||||
next = None
|
next = None
|
||||||
|
|
||||||
# This filtering has to be done *after* getting next/prev links
|
# This filtering has to be done *after* getting next/prev links
|
||||||
if request.session.get('filter_replies', False):
|
if account.preferences.filter_replies:
|
||||||
data = [x for x in data if not x.in_reply_to_id]
|
data = [x for x in data if not x.in_reply_to_id]
|
||||||
if request.session.get('filter_boosts', False):
|
if account.preferences.filter_boosts:
|
||||||
data = [x for x in data if not x.reblog]
|
data = [x for x in data if not x.reblog]
|
||||||
return render(request, 'main/%s_timeline.html' % timeline,
|
return render(request, 'main/%s_timeline.html' % timeline,
|
||||||
{'toots': data, 'form': form, 'timeline': timeline,
|
{'toots': data, 'form': form, 'timeline': timeline,
|
||||||
|
|
Loading…
Reference in New Issue