mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
More fixes for enums.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -633,7 +633,7 @@ def get_detailed_services(
|
||||
|
||||
@service_blueprint.route("/<uuid:service_id>/guest-list", methods=["GET"])
|
||||
def get_guest_list(service_id):
|
||||
from app.enums import GuestListRecipientType
|
||||
from app.enums import RecipientType
|
||||
|
||||
service = dao_fetch_service_by_id(service_id)
|
||||
|
||||
@@ -645,12 +645,12 @@ def get_guest_list(service_id):
|
||||
email_addresses=[
|
||||
item.recipient
|
||||
for item in guest_list
|
||||
if item.recipient_type == GuestListRecipientType.EMAIL
|
||||
if item.recipient_type == RecipientType.EMAIL
|
||||
],
|
||||
phone_numbers=[
|
||||
item.recipient
|
||||
for item in guest_list
|
||||
if item.recipient_type == GuestListRecipientType.MOBILE
|
||||
if item.recipient_type == RecipientType.MOBILE
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import itertools
|
||||
from notifications_utils.recipients import allowed_to_send_to
|
||||
|
||||
from app.dao.services_dao import dao_fetch_service_by_id
|
||||
from app.enums import GuestListRecipientType
|
||||
from app.enums import RecipientType
|
||||
from app.models import KEY_TYPE_NORMAL, KEY_TYPE_TEAM, KEY_TYPE_TEST, ServiceGuestList
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ def get_guest_list_objects(service_id, request_json):
|
||||
ServiceGuestList.from_string(service_id, type, recipient)
|
||||
for type, recipient in (
|
||||
get_recipients_from_request(
|
||||
request_json, "phone_numbers", GuestListRecipientType.MOBILE
|
||||
request_json, "phone_numbers", RecipientType.MOBILE
|
||||
)
|
||||
+ get_recipients_from_request(
|
||||
request_json, "email_addresses", GuestListRecipientType.EMAIL
|
||||
request_json, "email_addresses", RecipientType.EMAIL
|
||||
)
|
||||
)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user