separated clients handlers, cart->checkout ppline
This commit is contained in:
10
misc/utils.py
Normal file
10
misc/utils.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import phonenumbers
|
||||
from phonenumbers import NumberParseException
|
||||
|
||||
|
||||
def is_valid_phone(phone: str, region="RU") -> bool:
|
||||
try:
|
||||
parsed = phonenumbers.parse(phone, region)
|
||||
return phonenumbers.is_valid_number(parsed)
|
||||
except NumberParseException:
|
||||
return False
|
||||
Reference in New Issue
Block a user