mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
fix local filter for suggested users
This commit is contained in:
parent
864d8cea2b
commit
e261bfdb6a
1 changed files with 2 additions and 5 deletions
|
@ -81,7 +81,7 @@ class SuggestedUsers(RedisStore):
|
|||
"""take a user out of someone's suggestions"""
|
||||
self.bulk_remove_objects_from_store([suggested_user], self.store_id(user))
|
||||
|
||||
def get_suggestions(self, user, **filters):
|
||||
def get_suggestions(self, user, local=False):
|
||||
"""get suggestions"""
|
||||
values = self.get_store(self.store_id(user), withscores=True)
|
||||
results = []
|
||||
|
@ -97,10 +97,7 @@ class SuggestedUsers(RedisStore):
|
|||
logger.exception(err)
|
||||
continue
|
||||
user.mutuals = counts["mutuals"]
|
||||
if filters.local:
|
||||
if user.local:
|
||||
results.append(user)
|
||||
else:
|
||||
if (local and user.local) or not local:
|
||||
results.append(user)
|
||||
if len(results) >= 5:
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue