mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
All string "constants" in app.models converted to app.enums.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -13,12 +13,9 @@ from app.dao.service_inbound_api_dao import (
|
||||
reset_service_inbound_api,
|
||||
save_service_inbound_api,
|
||||
)
|
||||
from app.enums import CallbackType
|
||||
from app.errors import InvalidRequest, register_errors
|
||||
from app.models import (
|
||||
DELIVERY_STATUS_CALLBACK_TYPE,
|
||||
ServiceCallbackApi,
|
||||
ServiceInboundApi,
|
||||
)
|
||||
from app.models import ServiceCallbackApi, ServiceInboundApi
|
||||
from app.schema_validation import validate
|
||||
from app.service.service_callback_api_schema import (
|
||||
create_service_callback_api_schema,
|
||||
@@ -90,7 +87,7 @@ def create_service_callback_api(service_id):
|
||||
data = request.get_json()
|
||||
validate(data, create_service_callback_api_schema)
|
||||
data["service_id"] = service_id
|
||||
data["callback_type"] = DELIVERY_STATUS_CALLBACK_TYPE
|
||||
data["callback_type"] = CallbackType.DELIVERY_STATUS
|
||||
callback_api = ServiceCallbackApi(**data)
|
||||
try:
|
||||
save_service_callback_api(callback_api)
|
||||
|
||||
@@ -6,8 +6,7 @@ from app.dao.service_sms_sender_dao import dao_get_service_sms_senders_by_id
|
||||
from app.dao.services_dao import dao_fetch_service_by_id
|
||||
from app.dao.templates_dao import dao_get_template_by_id_and_service_id
|
||||
from app.dao.users_dao import get_user_by_id
|
||||
from app.enums import NotificationType, KeyType
|
||||
from app.models import PRIORITY
|
||||
from app.enums import NotificationType, KeyType, TemplateProcessType
|
||||
from app.notifications.process_notifications import (
|
||||
persist_notification,
|
||||
send_notification_to_queue,
|
||||
@@ -81,7 +80,7 @@ def send_one_off_notification(service_id, post_data):
|
||||
client_reference=client_reference,
|
||||
)
|
||||
|
||||
queue_name = QueueNames.PRIORITY if template.process_type == PRIORITY else None
|
||||
queue_name = QueueNames.PRIORITY if template.process_type == TemplateProcessType.PRIORITY else None
|
||||
|
||||
send_notification_to_queue(
|
||||
notification=notification,
|
||||
|
||||
Reference in New Issue
Block a user