mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 13:01:08 +00:00
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 import activitystreams, forms, models
|
||||||
from bookwyrm.activitypub import ActivitypubResponse
|
from bookwyrm.activitypub import ActivitypubResponse
|
||||||
from bookwyrm.models import User
|
|
||||||
from bookwyrm.settings import PAGE_LENGTH, STREAMS
|
from bookwyrm.settings import PAGE_LENGTH, STREAMS
|
||||||
from bookwyrm.suggested_users import suggested_users
|
from bookwyrm.suggested_users import suggested_users
|
||||||
from .helpers import get_user_from_username
|
from .helpers import get_user_from_username
|
||||||
|
@ -24,6 +23,7 @@ class Feed(View):
|
||||||
"""activity stream"""
|
"""activity stream"""
|
||||||
|
|
||||||
def post(self, request, tab):
|
def post(self, request, tab):
|
||||||
|
"""save feed settings form, with a silent validation fail"""
|
||||||
settings_saved = False
|
settings_saved = False
|
||||||
form = forms.FeedStatusTypes(request.POST, instance=request.user)
|
form = forms.FeedStatusTypes(request.POST, instance=request.user)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
|
@ -250,7 +250,11 @@ def get_suggested_books(user, max_books=5):
|
||||||
return suggested_books
|
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:
|
if "review" not in allowed_types:
|
||||||
activities = activities.filter(Q(review__isnull=True))
|
activities = activities.filter(Q(review__isnull=True))
|
||||||
if "comment" not in allowed_types:
|
if "comment" not in allowed_types:
|
||||||
|
|
Loading…
Reference in a new issue