forked from mirrors/bookwyrm
Fix pylint
This commit is contained in:
parent
bc7de410b7
commit
0b46db49a3
1 changed files with 6 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue