Auto-format phone number when saving for contact records
This commit is contained in:
parent
b64f6c7884
commit
604420c7d4
|
@ -3864,6 +3864,7 @@ class MasterView(View):
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
def objectify_contact(self, contact, data):
|
def objectify_contact(self, contact, data):
|
||||||
|
app = self.get_rattail_app()
|
||||||
|
|
||||||
if 'default_email' in data:
|
if 'default_email' in data:
|
||||||
address = data['default_email']
|
address = data['default_email']
|
||||||
|
@ -3877,7 +3878,7 @@ class MasterView(View):
|
||||||
contact.add_email_address(address)
|
contact.add_email_address(address)
|
||||||
|
|
||||||
if 'default_phone' in data:
|
if 'default_phone' in data:
|
||||||
number = data['default_phone']
|
number = app.format_phone_number(data['default_phone'])
|
||||||
if contact.phones:
|
if contact.phones:
|
||||||
if number:
|
if number:
|
||||||
phone = contact.phones[0]
|
phone = contact.phones[0]
|
||||||
|
|
Loading…
Reference in a new issue