mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 09:21:39 -05:00
16 lines
509 B
Python
16 lines
509 B
Python
from utils.recipients import format_phone_number, validate_phone_number
|
|
|
|
|
|
def allowed_send_to_number(service, to):
|
|
if service.restricted and format_phone_number(validate_phone_number(to)) not in [
|
|
format_phone_number(validate_phone_number(user.mobile_number)) for user in service.users
|
|
]:
|
|
return False
|
|
return True
|
|
|
|
|
|
def allowed_send_to_email(service, to):
|
|
if service.restricted and to not in [user.email_address for user in service.users]:
|
|
return False
|
|
return True
|