mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 04:51:11 +00:00
Remove unnecessary conversions between list and set
This commit is contained in:
parent
321397a349
commit
439cb3ccaa
1 changed files with 2 additions and 2 deletions
|
@ -156,7 +156,7 @@ class ActivityStream(RedisStore):
|
||||||
status_author = models.User.objects.filter(
|
status_author = models.User.objects.filter(
|
||||||
is_active=True, local=True, id=status.user.id
|
is_active=True, local=True, id=status.user.id
|
||||||
).values_list("id", flat=True)
|
).values_list("id", flat=True)
|
||||||
return list(set(list(audience) + list(status_author)))
|
return list(set(audience) | set(status_author))
|
||||||
|
|
||||||
def get_stores_for_users(self, user_ids):
|
def get_stores_for_users(self, user_ids):
|
||||||
"""convert a list of user ids into redis store ids"""
|
"""convert a list of user ids into redis store ids"""
|
||||||
|
@ -191,7 +191,7 @@ class HomeStream(ActivityStream):
|
||||||
status_author = models.User.objects.filter(
|
status_author = models.User.objects.filter(
|
||||||
is_active=True, local=True, id=status.user.id
|
is_active=True, local=True, id=status.user.id
|
||||||
).values_list("id", flat=True)
|
).values_list("id", flat=True)
|
||||||
return list(set(list(audience) + list(status_author)))
|
return list(set(audience) | set(status_author))
|
||||||
|
|
||||||
def get_statuses_for_user(self, user):
|
def get_statuses_for_user(self, user):
|
||||||
return models.Status.privacy_filter(
|
return models.Status.privacy_filter(
|
||||||
|
|
Loading…
Reference in a new issue