Link Application to Player if exists
parent
c45f5529c7
commit
16825f0dd2
|
@ -93,6 +93,10 @@ class Discord(discord.Client):
|
||||||
if not application.accepted:
|
if not application.accepted:
|
||||||
application.accepted = accept
|
application.accepted = accept
|
||||||
application.save()
|
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")
|
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)
|
api.plugin("accept" if accept else "deny", application.username)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue