Use people handler to update address

This commit is contained in:
Lance Edgar 2022-10-18 10:55:47 -05:00
parent 620447f029
commit 9b101963e5

View file

@ -859,16 +859,8 @@ class PersonView(MasterView):
data = dict(self.request.json_body)
# update person address
address = person.address
if not address:
address = person.add_address()
address.street = data['street']
address.street2 = data['street2']
address.city = data['city']
address.state = data['state']
address.zipcode = data['zipcode']
self.handler.mark_address_invalid(person, address, data['invalid'])
address = self.people_handler.ensure_address(person)
self.people_handler.update_address(person, address, **data)
self.Session.flush()
return {