Auto-format phone number when saving for contact records

This commit is contained in:
Lance Edgar 2022-11-23 12:27:09 -06:00
parent b64f6c7884
commit 604420c7d4

View file

@ -3864,6 +3864,7 @@ class MasterView(View):
return obj
def objectify_contact(self, contact, data):
app = self.get_rattail_app()
if 'default_email' in data:
address = data['default_email']
@ -3877,7 +3878,7 @@ class MasterView(View):
contact.add_email_address(address)
if 'default_phone' in data:
number = data['default_phone']
number = app.format_phone_number(data['default_phone'])
if contact.phones:
if number:
phone = contact.phones[0]