1
0
mirror of https://gitlab.com/brutaldon/brutaldon.git synced 2024-12-04 14:46:24 -05:00

Make filtering preference work again

This commit is contained in:
Jason McBrayer 2018-08-26 19:47:48 -04:00
parent 6bb4a428d7
commit 743bdc856c
2 changed files with 21 additions and 2 deletions

View File

@ -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'),
),
]

View File

@ -103,9 +103,9 @@ def timeline(request, timeline='home', timeline_name='Home', max_id=None, since_
next = None
# 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]
if request.session.get('filter_boosts', False):
if account.preferences.filter_boosts:
data = [x for x in data if not x.reblog]
return render(request, 'main/%s_timeline.html' % timeline,
{'toots': data, 'form': form, 'timeline': timeline,