Skip to content

Commit ad53096

Browse files
committed
Fix phone number digit validation
1 parent db6676d commit ad53096

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Change Log
22
==========
33

4+
0.4.0 (12/22/2021)
5+
------------------
6+
- Fix phone number digit validation
7+
48
0.3.9 (12/20/2021)
59
------------------
610
- Create a separate method to validate input arguments

gmailconnector/send_sms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def arg_validator(self):
7676
raise ValueError(
7777
'Cannot proceed without the args: `gmail_user`, `gmail_pass`, `phone` and `message`'
7878
)
79-
if len(self.phone) != 10 or not len(self.phone) != 12:
79+
if len(self.phone) != 10 and len(self.phone) != 12:
8080
raise ValueError('Phone number should either be 10 or 12 digits (if includes country code)')
8181
if self.phone.startswith('+') and not self.phone.startswith('+1'):
8282
raise ValueError('Unsupported country code. Module works only for US based contact numbers.')

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version_info = (0, 3, 9)
1+
version_info = (0, 4, 0)

0 commit comments

Comments
 (0)