Rename function in service utils

To reflect the new name of the feature.

squash! Rename function in service utils

Rename function, variable and argument names in service utils
This commit is contained in:
Chris Hill-Scott
2020-07-28 10:19:46 +01:00
parent 6384b9ef4f
commit 4d896aa642
5 changed files with 14 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ def get_recipients_from_request(request_json, key, type):
return [(type, recipient) for recipient in request_json.get(key)]
def get_whitelist_objects(service_id, request_json):
def get_guest_list_objects(service_id, request_json):
return [
ServiceWhitelist.from_string(service_id, type, recipient)
for type, recipient in (
@@ -28,7 +28,7 @@ def get_whitelist_objects(service_id, request_json):
]
def service_allowed_to_send_to(recipient, service, key_type, allow_whitelisted_recipients=True):
def service_allowed_to_send_to(recipient, service, key_type, allow_guest_list_recipients=True):
if key_type == KEY_TYPE_TEST:
return True
@@ -42,9 +42,9 @@ def service_allowed_to_send_to(recipient, service, key_type, allow_whitelisted_r
team_members = itertools.chain.from_iterable(
[user.mobile_number, user.email_address] for user in service.users
)
whitelist_members = [
guest_list_members = [
member.recipient for member in service.whitelist
if allow_whitelisted_recipients
if allow_guest_list_recipients
]
if (
@@ -55,6 +55,6 @@ def service_allowed_to_send_to(recipient, service, key_type, allow_whitelisted_r
recipient,
itertools.chain(
team_members,
whitelist_members
guest_list_members
)
)