mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Rename whitelist DAO functions
To reflect the new name of the feature.
This commit is contained in:
@@ -75,9 +75,9 @@ from app.dao.services_dao import (
|
||||
get_services_by_partial_name,
|
||||
)
|
||||
from app.dao.service_whitelist_dao import (
|
||||
dao_fetch_service_whitelist,
|
||||
dao_add_and_commit_whitelisted_contacts,
|
||||
dao_remove_service_whitelist
|
||||
dao_fetch_service_guest_list,
|
||||
dao_add_and_commit_guest_list_contacts,
|
||||
dao_remove_service_guest_list
|
||||
)
|
||||
from app.dao.service_email_reply_to_dao import (
|
||||
add_reply_to_email_address_for_service,
|
||||
@@ -569,7 +569,7 @@ def get_guest_list(service_id):
|
||||
if not service:
|
||||
raise InvalidRequest("Service does not exist", status_code=404)
|
||||
|
||||
guest_list = dao_fetch_service_whitelist(service.id)
|
||||
guest_list = dao_fetch_service_guest_list(service.id)
|
||||
return jsonify(
|
||||
email_addresses=[item.recipient for item in guest_list
|
||||
if item.recipient_type == EMAIL_TYPE],
|
||||
@@ -582,7 +582,7 @@ def get_guest_list(service_id):
|
||||
@service_blueprint.route('/<uuid:service_id>/guest-list', methods=['PUT'])
|
||||
def update_guest_list(service_id):
|
||||
# doesn't commit so if there are any errors, we preserve old values in db
|
||||
dao_remove_service_whitelist(service_id)
|
||||
dao_remove_service_guest_list(service_id)
|
||||
try:
|
||||
guest_list_objects = get_whitelist_objects(service_id, request.get_json())
|
||||
except ValueError as e:
|
||||
@@ -591,7 +591,7 @@ def update_guest_list(service_id):
|
||||
msg = '{} is not a valid email address or phone number'.format(str(e))
|
||||
raise InvalidRequest(msg, 400)
|
||||
else:
|
||||
dao_add_and_commit_whitelisted_contacts(guest_list_objects)
|
||||
dao_add_and_commit_guest_list_contacts(guest_list_objects)
|
||||
return '', 204
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user