Use people handler to update address
This commit is contained in:
parent
620447f029
commit
9b101963e5
|
@ -859,16 +859,8 @@ class PersonView(MasterView):
|
||||||
data = dict(self.request.json_body)
|
data = dict(self.request.json_body)
|
||||||
|
|
||||||
# update person address
|
# update person address
|
||||||
address = person.address
|
address = self.people_handler.ensure_address(person)
|
||||||
if not address:
|
self.people_handler.update_address(person, address, **data)
|
||||||
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'])
|
|
||||||
|
|
||||||
self.Session.flush()
|
self.Session.flush()
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue