fix: skip invalid numbers on SMS receiver_list (#22879)
This PR switches the loop in the `validate_receiver_nos` function in the SMS Settings Doctype from `break` to `continue`. The prior functionality would throw an error if any recipients on the receiver_list were invalid, which created an issue with SMS notifications that send to a user role, since any user without a valid mobile phone number would prevent the notification sending to any users (even those with valid mobile numbers). By switching the loop from `break` to `continue`, the function still eliminates invalid entries and enforces the existence of at least one valid phone number, but doesn't break sending based on a single absent or invalid recipient entry. [skip ci]
This commit is contained in:
parent
6b1ec4703d
commit
0c0fbc4248
1 changed files with 1 additions and 1 deletions
|
|
@ -30,7 +30,7 @@ def validate_receiver_nos(receiver_list):
|
|||
validated_receiver_list = []
|
||||
for d in receiver_list:
|
||||
if not d:
|
||||
break
|
||||
continue
|
||||
|
||||
# remove invalid character
|
||||
for x in [" ", "-", "(", ")"]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue