diff --git a/bookwyrm/views/feed.py b/bookwyrm/views/feed.py index 49b8f73b8..165e662fc 100644 --- a/bookwyrm/views/feed.py +++ b/bookwyrm/views/feed.py @@ -11,7 +11,6 @@ from django.views import View from bookwyrm import activitystreams, forms, models from bookwyrm.activitypub import ActivitypubResponse -from bookwyrm.models import User from bookwyrm.settings import PAGE_LENGTH, STREAMS from bookwyrm.suggested_users import suggested_users from .helpers import get_user_from_username @@ -24,6 +23,7 @@ class Feed(View): """activity stream""" def post(self, request, tab): + """save feed settings form, with a silent validation fail""" settings_saved = False form = forms.FeedStatusTypes(request.POST, instance=request.user) if form.is_valid(): @@ -250,7 +250,11 @@ def get_suggested_books(user, max_books=5): return suggested_books -def filter_stream_by_status_type(activities, allowed_types=[]): +def filter_stream_by_status_type(activities, allowed_types=None): + if not allowed_types: + allowed_types = [] + + """filter out activities based on types""" if "review" not in allowed_types: activities = activities.filter(Q(review__isnull=True)) if "comment" not in allowed_types: