Fixed 'add_resident'
parent
02845efaf2
commit
6b210cf0de
|
@ -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)
|
town = get_location(owner, town_name, Town)
|
||||||
|
|
||||||
if town.residents.filter(Q(town__owner__name__iexact=new_resident_name) |
|
if town.residents.filter(id=new_resident.id).exists() | town.owner.filter(id=new_resident.id).exists():
|
||||||
Q(name__iexact=new_resident_name)).all().count():
|
|
||||||
raise IsResidentError
|
raise IsResidentError
|
||||||
|
|
||||||
town.residents.add(new_resident)
|
town.residents.add(new_resident)
|
||||||
|
|
Loading…
Reference in New Issue