attempt to pull logos from the admin app's static images directory

(this is configured by a config value)
This commit is contained in:
Leo Hemsted
2016-08-05 17:26:40 +01:00
parent ebb8947290
commit e88624ed4a
3 changed files with 22 additions and 17 deletions

View File

@@ -1,27 +1,27 @@
from datetime import datetime
from monotonic import monotonic
from urllib.parse import urljoin
from flask import current_app
from notifications_utils.recipients import (
validate_and_format_phone_number
)
from notifications_utils.template import Template, get_sms_fragment_count
from notifications_utils.renderers import HTMLEmail, PlainTextEmail, SMSMessage
from app import notify_celery, statsd_client, clients, create_uuid
from app.clients.email import EmailClientException
from app.clients.sms import SmsClientException
from app.dao.notifications_dao import (
update_provider_stats,
get_notification_by_id,
dao_update_notification,
update_notification_status_by_id
)
from app.dao.provider_details_dao import get_provider_details_by_notification_type
from app.dao.services_dao import dao_fetch_service_by_id
from app.celery.research_mode_tasks import send_sms_response, send_email_response
from notifications_utils.recipients import (
validate_and_format_phone_number
)
from app.dao.templates_dao import dao_get_template_by_id
from notifications_utils.template import Template, get_sms_fragment_count
from notifications_utils.renderers import HTMLEmail, PlainTextEmail, SMSMessage
from app.models import SMS_TYPE, EMAIL_TYPE, KEY_TYPE_TEST, BRANDING_ORG
from app.statsd_decorators import statsd
@@ -190,9 +190,14 @@ def send_email_to_provider(self, service_id, notification_id):
def get_html_email_renderer(service):
govuk_banner = service.branding != BRANDING_ORG
if service.organisation:
logo = '{}{}{}'.format(
current_app.config['ADMIN_BASE_URL'],
current_app.config['BRANDING_PATH'],
service.organisation.logo
)
branding = {
'brand_colour': service.organisation.colour,
'brand_logo': service.organisation.logo,
'brand_logo': logo,
'brand_name': service.organisation.name,
}
else: