From c745422578cdbf584e28c28482fbaabc7e90f548 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 23 Aug 2016 12:00:26 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20prefix=20text=20messages=20is?= =?UTF-8?q?=20sender=20name=20is=20set=20Implements:=20-=20[x]=20alphagov/?= =?UTF-8?q?notifications-utils#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main/views/send.py | 32 +++++++++++++++++--------------- requirements.txt | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/main/views/send.py b/app/main/views/send.py index 6d0e40597..851042b7b 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -75,7 +75,8 @@ def choose_template(service_id, template_type): templates=[ Template( template, - prefix=current_service['name'] + prefix=current_service['name'], + sms_sender=current_service['sms_sender'] ) for template in service_api_client.get_service_templates(service_id)['data'] if template['template_type'] == template_type ], @@ -90,7 +91,8 @@ def choose_template(service_id, template_type): def send_messages(service_id, template_id): template = Template( service_api_client.get_service_template(service_id, template_id)['data'], - prefix=current_service['name'] + prefix=current_service['name'], + sms_sender=current_service['sms_sender'] ) form = CsvUploadForm() @@ -149,7 +151,8 @@ def send_test(service_id, template_id): template = Template( service_api_client.get_service_template(service_id, template_id)['data'], - prefix=current_service['name'] + prefix=current_service['name'], + sms_sender=current_service['sms_sender'] ) if len(template.placeholders) == 0 or request.method == 'POST': @@ -189,13 +192,13 @@ def send_test(service_id, template_id): @main.route("/services//send//from-api", methods=['GET']) @login_required def send_from_api(service_id, template_id): - template = Template( - service_api_client.get_service_template(service_id, template_id)['data'], - prefix=current_service['name'] - ) return render_template( 'views/send-from-api.html', - template=template + template=Template( + service_api_client.get_service_template(service_id, template_id)['data'], + prefix=current_service['name'], + sms_sender=current_service['sms_sender'] + ) ) @@ -216,14 +219,13 @@ def check_messages(service_id, template_type, upload_id): if not contents: flash('There was a problem reading your upload file') - template = service_api_client.get_service_template( - service_id, - session['upload_data'].get('template_id') - )['data'] - template = Template( - template, - prefix=current_service['name'] + service_api_client.get_service_template( + service_id, + session['upload_data'].get('template_id') + )['data'], + prefix=current_service['name'], + sms_sender=current_service['sms_sender'] ) recipients = RecipientCSV( diff --git a/requirements.txt b/requirements.txt index 74a05fa59..65c82049c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,4 +19,4 @@ pytz==2016.4 git+https://github.com/alphagov/notifications-python-client.git@1.0.0#egg=notifications-python-client==1.0.0 -git+https://github.com/alphagov/notifications-utils.git@8.7.5#egg=notifications-utils==8.7.5 +git+https://github.com/alphagov/notifications-utils.git@9.0.0#egg=notifications-utils==9.0.0