Update limit to message_limit.

Further db changes and updates.

Remove traceback print out.

Fix bug in passing template id to a task.
This commit is contained in:
Nicholas Staples
2016-04-08 16:13:10 +01:00
parent c4b316bde6
commit 90f0505a3d
19 changed files with 116 additions and 116 deletions

View File

@@ -8,7 +8,7 @@ ses_response_map = {
'Bounce': {
"message": 'Bounced',
"success": False,
"notification_status": 'bounce',
"notification_status": 'failed',
"notification_statistics_status": STATISTICS_FAILURE
},
'Delivery': {
@@ -19,9 +19,9 @@ ses_response_map = {
},
'Complaint': {
"message": 'Complaint',
"success": False,
"notification_status": 'complaint',
"notification_statistics_status": STATISTICS_FAILURE
"success": True,
"notification_status": 'delivered',
"notification_statistics_status": STATISTICS_DELIVERED
}
}

View File

@@ -25,9 +25,9 @@ firetext_responses = {
},
'2': {
"message": 'Undelivered (Pending with Network)',
"success": False,
"notification_statistics_status": None,
"notification_status": 'sent'
"success": True,
"notification_statistics_status": STATISTICS_DELIVERED,
"notification_status": 'delivered'
}
}

View File

@@ -44,8 +44,10 @@ class TwilioClient(SmsClient):
def status(self, message_id):
try:
response = self.client.messages.get(message_id)
if response.status in ('delivered', 'undelivered', 'failed'):
if response.status in ('delivered', 'failed'):
return response.status
elif response.status == 'undelivered':
return 'sending'
return None
except TwilioRestException as e:
current_app.logger.exception(e)