From 2c1c5d214f345073b68fe527d123af31d2b31358 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Thu, 26 Sep 2019 10:22:55 -0500 Subject: [PATCH] Various command fixes --- GeoffreyApp/api/commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GeoffreyApp/api/commands.py b/GeoffreyApp/api/commands.py index c0ea70c..2782cea 100644 --- a/GeoffreyApp/api/commands.py +++ b/GeoffreyApp/api/commands.py @@ -545,7 +545,7 @@ def edit_pos(x, z, loc_name, discord_uuid=None, mc_uuid=None): :param loc_name: Location Name to edit :param discord_uuid: Discord UUID :param mc_uuid: MC UUID - :return: Edited Locatio + :return: Edited Location :raises: :raises: PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase :help: Edits the position of a location @@ -643,7 +643,7 @@ def delete_item(item, shop_name=None, discord_uuid=None, mc_uuid=None): @command(RequestTypes.POST) -def delete_resource(resource_name, farm_name=None, discord_uuid=None, mc_uuid=None): +def delete_resource(resource, farm_name=None, discord_uuid=None, mc_uuid=None): """ :request: POST :param resource: resource to delete @@ -659,7 +659,7 @@ def delete_resource(resource_name, farm_name=None, discord_uuid=None, mc_uuid=No farm = get_location(player, farm_name, PublicFarm) - delete_list = Resource.objects.filter(resource_name=resource_name, farm=farm).all() + delete_list = Resource.objects.filter(resource_name=resource, farm=farm).all() if len(delete_list) == 0: raise ResourceNotFoundError @@ -741,7 +741,7 @@ def add_owner(new_owner_name, location_name, discord_uuid=None, mc_uuid=None): location = get_location(owner, location_name, Location) - if location.owner.filter(location__owner__name__iexact=new_owner_name): + if location.owner.filter(id=new_owner.id): raise IsOwnerError location.owner.add(new_owner)