Replace Deskpro ad-hoc requests with a client from utils

Moves the duplicated calls to Deskpro to notification_utils and
rewrites feedback and service go-live requests to use the shared
client.
This commit is contained in:
Alexey Bezhan
2018-01-16 11:50:29 +00:00
parent c3c3ce05d6
commit a23efc9a93
6 changed files with 84 additions and 180 deletions

View File

@@ -25,6 +25,7 @@ from functools import partial
from notifications_python_client.errors import HTTPError
from notifications_utils import logging, request_helper, formatters
from notifications_utils.clients import DeskproClient
from notifications_utils.clients.statsd.statsd_client import StatsdClient
from notifications_utils.recipients import (
validate_phone_number,
@@ -73,6 +74,7 @@ provider_client = ProviderClient()
organisations_client = OrganisationsClient()
asset_fingerprinter = AssetFingerprinter()
statsd_client = StatsdClient()
deskpro_client = DeskproClient()
letter_jobs_client = LetterJobsClient()
inbound_number_client = InboundNumberClient()
billing_api_client = BillingAPIClient()
@@ -90,6 +92,7 @@ def create_app(application):
init_app(application)
statsd_client.init_app(application)
deskpro_client.init_app(application)
logging.init_app(application, statsd_client)
csrf.init_app(application)
request_helper.init_app(application)