diff --git a/GeoffreyApp/api/commands.py b/GeoffreyApp/api/commands.py index a4fc82c..f630d25 100644 --- a/GeoffreyApp/api/commands.py +++ b/GeoffreyApp/api/commands.py @@ -49,6 +49,9 @@ def parse_help(func): def get_player(discord_uuid=None, mc_uuid=None): try: + discord_uuid = str(discord_uuid) + mc_uuid = str(mc_uuid) + if discord_uuid is not None: player = Player.objects.get(discord_uuid__iexact=discord_uuid) elif mc_uuid is not None: @@ -291,7 +294,8 @@ def delete(name, discord_uuid=None, mc_uuid=None): owner = get_player(discord_uuid, mc_uuid) try: - Location.objects.get(name__iexact=name, owner=owner).delete() + if Location.objects.get(name__iexact=name, owner=owner).delete() == 0: + raise Location.DoesNotExist except Location.DoesNotExist: raise LocationLookUpError