Commit Graph

696 Commits

Author SHA1 Message Date
Martyn Inglis
290f416485 Various tidy ups and changes
- use new queue
- remove some new lines in AWS response data
- migration script to populate new fields
2016-06-01 16:57:57 +01:00
Leo Hemsted
a3b847bf64 tests for send_sms through mmg/firetext 2016-06-01 15:59:44 +01:00
Nicholas Staples
276ca15919 Provider stats only updated if the provider successfully sends the message. 2016-06-01 12:43:26 +01:00
Rebecca Law
047a7d5488 Only test the items of the template that can change on an update request.
Return 200 if no change is made.
2016-06-01 12:19:59 +01:00
Rebecca Law
05e72b07ae Return status code 304 when template is not updated.
Moved import
2016-06-01 11:50:45 +01:00
Rebecca Law
0a9cdbd75a Do not create a new version of the template if there is no change to the tempalte. 2016-06-01 10:53:03 +01:00
Martyn Inglis
909fac3c05 Added research mode tasks
- if a service is in research mode the don't send the notifications via the providers (MMG/SES/etc)
- instead set up a task to mimic those services callbacks - this completes the loop, and show stats, delivery receipts and so on.
- Use the "to" field to choose the response, allows users to create successful and errored notifications

temp fail sms, uses  "07833333333"
perm fail sms, uses = "07822222222"
success = "07811111111" (or anything else)

success email = "delivered@simulator.notify"
perm fail = "perm-fail@simulator.notify"
temp fail = "temp-fail@simulator.notify"
2016-05-31 16:55:26 +01:00
Nicholas Staples
79dfc360f2 Notification not created in send_sms or send_email when service is in restricted mode. 2016-05-31 14:55:06 +01:00
Martyn Inglis
9617f0748b Added some tests around creating and updated services
- ensure research mode is respected on creation and update
- ensure rest client gives an error for bad research mode update
2016-05-31 12:49:06 +01:00
Martyn Inglis
2108bb52d5 Reorder updates to the notification / stats tables to match create. 2016-05-31 10:17:15 +01:00
Rebecca Law
2bfa9b7e10 Merge branch 'master' into permanent-failure-firetext 2016-05-27 12:10:59 +01:00
Rebecca Law
885abcaf16 Make update notification status transcational.
Refactor methods for reusability.
2016-05-27 12:09:36 +01:00
Leo Hemsted
a90a18541f notifications/statistics returns when no stats exist for today
moved filtering from WHERE to JOIN ON so that when join suceeds but filter fails, we dont lose the service's data from the results set
2016-05-26 16:48:30 +01:00
Rebecca Law
25a1b7f31c Firetext does not have a status code for temporary-failure.
In order to set a message as temporary-failure, we check if it is in pending status first.
Otherwise a delivery receipt for failure is set to permanent failure.
2016-05-26 16:46:00 +01:00
Rebecca Law
c5ec07a9ce Merge branch 'master' into permanent-failure-firetext 2016-05-25 15:45:42 +01:00
Rebecca Law
83df16025d Merge pull request #347 from alphagov/get-jobs-created-in-last-7-days
Add a limit days query param for get all jobs.
2016-05-25 11:36:31 +01:00
Rebecca Law
a67793cf8a Updated date query so that the created_at date is truncated so that we get all jobs created number of days requested. 2016-05-25 11:13:49 +01:00
Rebecca Law
2a7872cce1 Add a limit days query param for get all jobs. 2016-05-24 17:21:04 +01:00
Rebecca Law
6735a7103c Merge pull request #345 from alphagov/notification-job-status-counts
Notification job status counts
2016-05-24 16:47:00 +01:00
Rebecca Law
d6c7f03607 Added another assert to the test 2016-05-24 16:37:05 +01:00
Rebecca Law
fa152c4431 Mark a declined message from Firetext as permanent-failure rather than failed. 2016-05-24 15:32:48 +01:00
Leo Hemsted
24625a44f3 prevent public api from sending archived templates 2016-05-24 13:08:38 +01:00
Leo Hemsted
7801efd5ca don't create job if template has been archived 2016-05-24 13:08:02 +01:00
Rebecca Law
e4eecb894a Update job.notifications_delivered and job.notifications_failed count when updating the status of a notification. 2016-05-24 11:31:44 +01:00
Rebecca Law
dff60175a4 Add jobs.notifications_delivered and jobs.notifications_failed counts to the jobs table. 2016-05-23 15:44:57 +01:00
Leo Hemsted
5ebae9c66c only return unarchived templates when getting all templates
get_specific_template functions happily return archived templates
2016-05-23 14:20:02 +01:00
Rebecca Law
cf2723bdc9 If the sms client provider sends more than one delivery receipt only take the update for the the first one.
Only update the notification.status if status = sending.
2016-05-20 17:04:56 +01:00
Rebecca Law
a8c79bf80d Merge pull request #334 from alphagov/case-insensitive-email
Make the get_user_by_email_address case insensitive.
2016-05-20 15:55:38 +01:00
Leo Hemsted
81e5eb2c0a return all zeros when NotificationStatistics dont exist 2016-05-20 15:24:57 +01:00
Rebecca Law
0f9a019945 Make the get_user_by_email_address case insenstive. 2016-05-20 13:43:31 +01:00
Leo Hemsted
1b27c15c16 /notifications/statistics now takes 'day' parameter
avoids potential issues with date.today being inconsistent with user timezone
2016-05-20 11:31:35 +01:00
Leo Hemsted
f7768366a1 added test_notification_statistics file
put in new rest subfolder in anticipation of refactoring test_rest.py
2016-05-20 09:57:31 +01:00
Nicholas Staples
1797d9360b Update template json to return created_at and updated_at. Also fixed a bug where updated_at was not being added to the templates_history model. 2016-05-19 17:02:55 +01:00
NIcholas Staples
e0f6b4e571 Merge pull request #327 from alphagov/add_job_row_number
Added job row number to the notification for csv jobs. All tests pass…
2016-05-19 14:33:21 +01:00
Adam Shimali
955005d7fe Added additional outcome status codes to mmg responses. 2016-05-19 11:27:22 +01:00
Nicholas Staples
0fe0c1d2b4 Added job row number to the notification for csv jobs. All tests passing. 2016-05-19 10:46:03 +01:00
NIcholas Staples
03df991b38 Merge pull request #326 from alphagov/test_task_bug
Fix test to check for decrypted dictionary value.
2016-05-18 16:22:45 +01:00
Nicholas Staples
c46216dd96 Fix test to check for decrypted dictionary value. 2016-05-18 14:28:19 +01:00
Nicholas Staples
15607c0977 Add server_commands and update readme.md
Update command to search for services from the user.
2016-05-18 12:20:56 +01:00
Nicholas Staples
6e7383de33 Removed template subject uniqueness 2016-05-18 10:00:09 +01:00
Rebecca Law
d0da4e1ef2 Merge branch 'master' into email-failures 2016-05-17 15:41:00 +01:00
Rebecca Law
281a93b32d Update ses callback to interpret hard and soft bounces.
If the notification has a status == sending then update the status otherwise do not update the status.
In other words do not change the status more than once.
2016-05-17 15:38:49 +01:00
Adam Shimali
e1685d6a45 Was incorrectly setting from not reply to 2016-05-17 14:31:33 +01:00
Rebecca Law
4762aef1aa Merge pull request #318 from alphagov/tech-failures
New notification status types
2016-05-17 13:50:57 +01:00
Rebecca Law
191a79f27b Add new failure status for notifications. 2016-05-17 13:06:08 +01:00
Adam Shimali
3812dac3fe Missing mock 2016-05-17 12:49:37 +01:00
Adam Shimali
642fb6f68b Process job for email uses reply to if present 2016-05-17 12:41:13 +01:00
Adam Shimali
682ea55d9e [WIP] save reply to email address on service 2016-05-17 10:56:02 +01:00
Rebecca Law
992f9d78f9 There is a problem where columns on the templates table were not set.
It is also discovered that columns that have a default value and use the version mixin must set the value when creating the db object before the insert otherwise the history table will be missing the default value.
Updated the templates_history.created_by_id with a value where missing, using the current version of the template for this value.
Update templates_history.archived to false. This is okay as we do not yet have a way to set this value to true.
Removed the versions attribute from the TemplateSchema, there is not a need for this column.
2016-05-16 16:16:14 +01:00
minglis
3c751d94a4 Merge pull request #309 from alphagov/statsd-integration
Statsd integration
2016-05-16 12:29:14 +01:00