diff --git a/api/views.py b/api/views.py index 26094ba..59c1657 100644 --- a/api/views.py +++ b/api/views.py @@ -268,10 +268,13 @@ class PluginAPI(View): player.last_seen = timezone.now().strftime("%Y-%m-%d") player.save() if new_player and ip.associated: + associated = [] for assoc in ip.associated: if assoc.uuid is not player.uuid and assoc.is_banned: - mcm_api.plugin("staff", "Server {0}'s IP matches the banned player {1}".format(player.username, assoc.username)) - mcm_api.discord_notification("{0}'s IP matches the banned player {1}".format(player.username, assoc.username), ping=True) + associated.append(assoc) + if associated: + mcm_api.plugin("staff", "Server {0}'s IP matches the banned player(s) {1}".format(player.username, ", ".join([assoc.username for assoc in associated]))) + mcm_api.discord_notification("{0}'s IP matches the banned player(s) {1}".format(player.username, ", ".join([assoc.username for assoc in associated])), ping=True) json['status'] = True json['message'] = "Updated {0}".format(post['username']) elif "register" == keyword: