diff --git a/GeoffreyApp/api/commands.py b/GeoffreyApp/api/commands.py index 2782cea..70659a6 100644 --- a/GeoffreyApp/api/commands.py +++ b/GeoffreyApp/api/commands.py @@ -151,8 +151,14 @@ def register(player_name, discord_uuid): mc_uuid = grab_UUID(player_name) try: - get_player(mc_uuid=mc_uuid) - raise PlayerInDBError + player = get_player(mc_uuid=mc_uuid) + + if len(discord_uuid) != 0 and len(player.discord_uuid) == 0: + player.discord_uuid = discord_uuid + player.save() + return player + else: + raise PlayerInDBError except PlayerNotFound: player = Player.objects.create(name=player_name, mc_uuid=mc_uuid, discord_uuid=discord_uuid) player.save()