From 6b210cf0de0c81e25bc02c9d07e4e656fb6c284f Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Wed, 25 Sep 2019 20:13:57 -0500 Subject: [PATCH] Fixed 'add_resident' --- GeoffreyApp/api/commands.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GeoffreyApp/api/commands.py b/GeoffreyApp/api/commands.py index 8ca13cc..c0ea70c 100644 --- a/GeoffreyApp/api/commands.py +++ b/GeoffreyApp/api/commands.py @@ -772,8 +772,7 @@ def add_resident(new_resident_name, town_name, discord_uuid=None, mc_uuid=None): town = get_location(owner, town_name, Town) - if town.residents.filter(Q(town__owner__name__iexact=new_resident_name) | - Q(name__iexact=new_resident_name)).all().count(): + if town.residents.filter(id=new_resident.id).exists() | town.owner.filter(id=new_resident.id).exists(): raise IsResidentError town.residents.add(new_resident)