facebook / facebook-python-business-sdk

Python SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
1.27k stars 629 forks source link

Return none in get_international_number if matched group is none #589

Closed dmi3coder closed 3 years ago

dmi3coder commented 3 years ago

There's a chance that some phone numbers can have incorrect structure that can't match the Normalise.get_international_number. Specifically international_number_regex.match(phone_number) could return None, and calling .group() on non will cause exception This pull request checks if international_number_regex.match(phone_number) returns None or not. Also renamed Normalize.is_international_number to Normalize.get_international_number since name is misleading, and method returns a value that's used later

facebook-github-bot commented 3 years ago

@donglinw-fb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot commented 3 years ago

@donglinw-fb merged this pull request in facebook/facebook-python-business-sdk@73880cd370867b199bc2d3677fe57514184dfb8c.