Only query players with a valid application in the bot

reminder
Etzelia 2018-12-08 23:35:29 -06:00
parent 489012c016
commit b91078a4a7
1 changed files with 2 additions and 2 deletions

View File

@ -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.")