From b91078a4a7dd2ac5f519ad0275fa06afd46ac7ea Mon Sep 17 00:00:00 2001 From: Etzelia Date: Sat, 8 Dec 2018 23:35:29 -0600 Subject: [PATCH] Only query players with a valid application in the bot --- api/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/bot.py b/api/bot.py index 785a650..e3c5794 100644 --- a/api/bot.py +++ b/api/bot.py @@ -119,8 +119,8 @@ class Discord(discord.Client): info += "\n**This is only 10 applications out of {0} found. Please narrow your search if possible.**".format( len(applications)) else: - players = Player.objects.filter(username__icontains=search)[:10] - count = Player.objects.filter(username__icontains=search).count() + players = Player.objects.filter(username__icontains=search, application__isnull=False)[:10] + count = Player.objects.filter(username__icontains=search, application__isnull=False).count() if count > 0: if count == 1: yield from self.discord_message(message.channel, "No applications matched, however there is a player match.")