From 16825f0dd225d8f916b6fd61fe9129aadc776d43 Mon Sep 17 00:00:00 2001 From: Etzelia Date: Wed, 16 Jan 2019 17:40:38 +0100 Subject: [PATCH] Link Application to Player if exists --- api/bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/bot.py b/api/bot.py index 30851b1..2f32173 100644 --- a/api/bot.py +++ b/api/bot.py @@ -93,6 +93,10 @@ class Discord(discord.Client): if not application.accepted: application.accepted = accept application.save() + if Player.objects.filter(username__iexact=application.username).exists(): + player = Player.objects.get(username__iexact=application.username) + player.application_id = application.id + player.save() msg = "App ID **{0}** was successfully {1}.".format(match.group(2), "accepted" if accept else "denied") api.plugin("accept" if accept else "deny", application.username) else: