Fixed 'add_resident'

doc_update
Joey Hines 2019-09-25 20:13:57 -05:00
parent 02845efaf2
commit 6b210cf0de
1 changed files with 1 additions and 2 deletions

View File

@ -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)