Don't include deleted users in suggested users query

Related: #2727
This commit is contained in:
Wesley Aptekar-Cassels 2023-04-07 04:17:51 -04:00
parent 4b1012b185
commit c89da1bd66

View file

@ -53,7 +53,7 @@ class SuggestedUsers(RedisStore):
def get_users_for_object(self, obj): # pylint: disable=no-self-use
"""given a user, who might want to follow them"""
return models.User.objects.filter(local=True,).exclude(
return models.User.objects.filter(local=True, is_active=True).exclude(
Q(id=obj.id) | Q(followers=obj) | Q(id__in=obj.blocks.all()) | Q(blocks=obj)
)