From 4ecdc9e4207f1bf47a83c2ee8b91066b342d0dd5 Mon Sep 17 00:00:00 2001 From: Nicholas Staples Date: Mon, 8 Feb 2016 09:41:10 +0000 Subject: [PATCH 1/2] Bug fixed for posting the correct type of notification to the aws queue. --- app/aws_sqs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/aws_sqs.py b/app/aws_sqs.py index 86b28eab8..1399bed80 100644 --- a/app/aws_sqs.py +++ b/app/aws_sqs.py @@ -13,6 +13,8 @@ def add_notification_to_queue(service_id, template_id, type_, notification): message_id = str(uuid.uuid4()) serializer = URLSafeSerializer(current_app.config.get('SECRET_KEY')) encrypted = serializer.dumps(notification, current_app.config.get('DANGEROUS_SALT')) + print("add_notification_to_queue") + print(type_) q.send_message(MessageBody=encrypted, MessageAttributes={'type': {'StringValue': type_, 'DataType': 'String'}, 'message_id': {'StringValue': message_id, 'DataType': 'String'}, From 409857fba645c3ca22d41721430f8ad15d140169 Mon Sep 17 00:00:00 2001 From: Nicholas Staples Date: Mon, 8 Feb 2016 09:43:19 +0000 Subject: [PATCH 2/2] Now done. --- app/aws_sqs.py | 2 -- app/user/rest.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/aws_sqs.py b/app/aws_sqs.py index 1399bed80..86b28eab8 100644 --- a/app/aws_sqs.py +++ b/app/aws_sqs.py @@ -13,8 +13,6 @@ def add_notification_to_queue(service_id, template_id, type_, notification): message_id = str(uuid.uuid4()) serializer = URLSafeSerializer(current_app.config.get('SECRET_KEY')) encrypted = serializer.dumps(notification, current_app.config.get('DANGEROUS_SALT')) - print("add_notification_to_queue") - print(type_) q.send_message(MessageBody=encrypted, MessageAttributes={'type': {'StringValue': type_, 'DataType': 'String'}, 'message_id': {'StringValue': message_id, 'DataType': 'String'}, diff --git a/app/user/rest.py b/app/user/rest.py index 96eba04d0..05aef526d 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -149,7 +149,7 @@ def send_user_code(user_id): 'from_address': 'notify@digital.cabinet-office.gov.uk', 'subject': 'Verification code', 'body': secret_code} - add_notification_to_queue(api_user['client'], 'admin', 'sms', notification) + add_notification_to_queue(api_user['client'], 'admin', 'email', notification) notify_alpha_client.send_email( email, secret_code,