Merge pull request #2799 from WesleyAC/suggested-users-check-is-active

Don't include deleted users in suggested users query
This commit is contained in:
Mouse Reeve 2023-04-07 06:12:38 -07:00 committed by GitHub
commit 206698238d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)
)