mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 05:43:12 -04:00
remove get_current_provider
the function no longer makes sense now that we send through both at the same time. mostly just used in old tests that we'll end up rewriting shortly anyway
This commit is contained in:
@@ -42,7 +42,7 @@ from app.dao.notifications_dao import (
|
||||
update_notification_status_by_reference,
|
||||
dao_get_notification_history_by_reference,
|
||||
)
|
||||
from app.dao.provider_details_dao import get_current_provider
|
||||
from app.dao.provider_details_dao import get_provider_details_by_notification_type
|
||||
from app.dao.service_email_reply_to_dao import dao_get_reply_to_by_id
|
||||
from app.dao.service_inbound_api_dao import get_service_inbound_api_for_service
|
||||
from app.dao.service_sms_sender_dao import dao_get_service_sms_senders_by_id
|
||||
@@ -352,7 +352,7 @@ def save_letter(
|
||||
@statsd(namespace="tasks")
|
||||
def update_letter_notifications_to_sent_to_dvla(self, notification_references):
|
||||
# This task will be called by the FTP app to update notifications as sent to DVLA
|
||||
provider = get_current_provider(LETTER_TYPE)
|
||||
provider = get_provider_details_by_notification_type(LETTER_TYPE)[0]
|
||||
|
||||
updated_count, _ = dao_update_notifications_by_reference(
|
||||
notification_references,
|
||||
|
||||
@@ -29,15 +29,6 @@ def get_alternative_sms_provider(identifier):
|
||||
raise ValueError('Unrecognised sms provider {}'.format(identifier))
|
||||
|
||||
|
||||
def get_current_provider(notification_type):
|
||||
return ProviderDetails.query.filter_by(
|
||||
notification_type=notification_type,
|
||||
active=True
|
||||
).order_by(
|
||||
asc(ProviderDetails.priority)
|
||||
).first()
|
||||
|
||||
|
||||
def dao_get_provider_versions(provider_id):
|
||||
return ProviderDetailsHistory.query.filter_by(
|
||||
id=provider_id
|
||||
@@ -61,11 +52,6 @@ def dao_reduce_sms_provider_priority(identifier):
|
||||
providers[identifier].priority = max(0, providers[identifier].priority - 10)
|
||||
providers[other].priority = min(100, providers[other].priority + 10)
|
||||
|
||||
|
||||
def dao_toggle_sms_provider(*args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def get_provider_details_by_notification_type(notification_type, supports_international=False):
|
||||
|
||||
filters = [ProviderDetails.notification_type == notification_type]
|
||||
|
||||
Reference in New Issue
Block a user