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
|
||||
|
||||
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]
|
||||
|
|
Loading…
Reference in a new issue