mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
Fixes wording in comments
This commit is contained in:
parent
5e932711f9
commit
2640c26bb1
3 changed files with 10 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
""" access the activity streams stored in redis """
|
||||
""" access the list streams stored in redis """
|
||||
from django.dispatch import receiver
|
||||
from django.db import transaction
|
||||
from django.db.models import signals, Count, Q
|
||||
|
@ -25,8 +25,8 @@ class ListsStream(RedisStore):
|
|||
self.add_object_to_related_stores(book_list)
|
||||
|
||||
def add_user_lists(self, viewer, user):
|
||||
"""add a user's listes to another user's feed"""
|
||||
# only add the listes that the viewer should be able to see
|
||||
"""add a user's lists to another user's feed"""
|
||||
# only add the lists that the viewer should be able to see
|
||||
lists = models.List.filter(user=user).privacy_filter(viewer)
|
||||
self.bulk_add_objects_to_store(lists, self.stream_id(viewer))
|
||||
|
||||
|
@ -110,7 +110,7 @@ class ListsStream(RedisStore):
|
|||
@receiver(signals.post_save, sender=models.List)
|
||||
# pylint: disable=unused-argument
|
||||
def add_list_on_create(sender, instance, created, *args, **kwargs):
|
||||
"""add newly created lists to activity feeds"""
|
||||
"""add newly created lists streamsstreams"""
|
||||
if not created:
|
||||
return
|
||||
# when creating new things, gotta wait on the transaction
|
||||
|
@ -120,7 +120,7 @@ def add_list_on_create(sender, instance, created, *args, **kwargs):
|
|||
@receiver(signals.pre_delete, sender=models.List)
|
||||
# pylint: disable=unused-argument
|
||||
def remove_list_on_delete(sender, instance, *args, **kwargs):
|
||||
"""add newly created lists to activity feeds"""
|
||||
"""remove deleted lists to streams"""
|
||||
remove_list_task.delay(instance.id)
|
||||
|
||||
|
||||
|
@ -199,7 +199,7 @@ def populate_lists_on_account_create(sender, instance, created, *args, **kwargs)
|
|||
# ---- TASKS
|
||||
@app.task(queue=MEDIUM)
|
||||
def populate_lists_task(user_id):
|
||||
"""background task for populating an empty activitystream"""
|
||||
"""background task for populating an empty list stream"""
|
||||
user = models.User.objects.get(id=user_id)
|
||||
ListsStream().populate_streams(user)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
""" Re-create user streams """
|
||||
""" Re-create list streams """
|
||||
from django.core.management.base import BaseCommand
|
||||
from bookwyrm import lists_stream, models
|
||||
|
||||
|
@ -17,9 +17,9 @@ def populate_lists_streams():
|
|||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""start all over with user streams"""
|
||||
"""start all over with lists streams"""
|
||||
|
||||
help = "Populate streams for all users"
|
||||
help = "Populate list streams for all users"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
|
|
|
@ -36,7 +36,7 @@ class ListsStreamSignals(TestCase):
|
|||
user=self.remote_user, name="hi", privacy="public"
|
||||
)
|
||||
with patch("bookwyrm.lists_stream.add_list_task.delay") as mock:
|
||||
lists_stream.add_list_on_create_command(book_list)
|
||||
lists_stream.add_list_on_create(models.List, book_list, True)
|
||||
self.assertEqual(mock.call_count, 1)
|
||||
args = mock.call_args[0]
|
||||
self.assertEqual(args[0], book_list.id)
|
||||
|
|
Loading…
Reference in a new issue