Commit Graph
7490 Commits
Author SHA1 Message Date
Rebecca Law 316b5d0e64 Move scheduled tasks into their own module.
There is no change to the functionality - only moving the code around.
2016-06-20 13:33:53 +01:00
Martyn Inglis 7d5c25bd48 Update visibility timeout on staging and live 2016-06-20 13:30:57 +01:00
minglis a786005474 Merge pull request #414 from alphagov/split-sms-and-retry
Split sms and retry
2016-06-20 12:23:36 +01:00
Rebecca Law 66c9c5fa16 Merge pull request #445 from alphagov/add-coveralls
Add code coverage
2016-06-20 10:21:11 +01:00
Rebecca Law 6ee26bb109 Merge pull request #441 from alphagov/consistent-json-responses
Update auth module to return consistently formed error messages.
2016-06-20 10:19:46 +01:00
Chris Hill-Scott 4f145c245a Add code coverage 2016-06-17 17:09:50 +01:00
Martyn Inglis 838bf1d7d4 Merge branch 'master' into split-sms-and-retry
Conflicts:
	app/celery/tasks.py
	tests/app/celery/test_tasks.py
2016-06-17 16:39:03 +01:00
Martyn Inglis 51c6d57a86 Changed the delay period. Now waits
10 seconds, 1 minute, 5 minutes, 1 hour and 4 hours.

Total elapsed wait is max 5 hours 6 minutes and 10 seconds.

Changed visibility window of SQS to be 4 hours 10 seconds, longer the max retry period.
2016-06-17 16:32:56 +01:00
Chris Hill-Scott 9a79f0fbbb Merge pull request #432 from alphagov/replace-placeholders-template
Add a ‘preview template’ endpoint
2016-06-17 15:30:04 +01:00
Rebecca Law d9ac254498 Merge pull request #440 from alphagov/clean-up-tasks
Remove the invitation email and reset password email tasks.
2016-06-17 14:25:51 +01:00
Rebecca Law 40fa394226 Update auth module to return consistently formed error messages.
We are trying to get all the error messages to return in the following format:
{result: error,
 message: ['what caused error': 'reason for error']
}
2016-06-17 14:22:58 +01:00
Rebecca Law fa6ae864d6 Remove the invitation email and reset password email tasks. 2016-06-17 13:49:33 +01:00
Chris Hill-Scott 0d9519c656 Remove wrapper around response object
Before:
```json
{'data': {'template': '…'}}
```

There’s no need to wrap the response in key because there will only
ever be one valid key for the template preview endpoint.

Flatter is better:
```json
{
  'content': '…',
  'subject': '…',
  'template_type': '…',
  …
}
```

The response will be different if there’s an error, but you should be
checking the status code first anyway.

This commit:
- changes the template preview endpoint to return the above format
- adds a test to make sure that the original `/service/…/template/…`
  endpoint still returns JSON in the same format (with a `data` key)
2016-06-17 12:57:43 +01:00
Adam Shimali 5378e6ebc1 Merge pull request #434 from alphagov/notification-stats-by-day
Endpoint for reading notification stats for a given day.
2016-06-17 12:03:40 +01:00
Rebecca Law 595a1d04db Merge pull request #435 from alphagov/use-notify-to-send-forgot-password
Use notify to send forgot password and invitation emails
2016-06-17 11:07:25 +01:00
Rebecca Law 4e640eea6d Remove print 2016-06-17 11:01:26 +01:00
Rebecca Law 2a142dd36b Merge pull request #429 from alphagov/refactor-query-filters
Refactor permissions dao
2016-06-17 10:55:40 +01:00
Adam Shimali dd8372a572 Updated for git comments 2016-06-17 10:15:57 +01:00
Chris Hill-Scott cf91ce57fc Add a ‘preview template’ endpoint
There’s a need for users of the API to be able to take advantage of
Notify’s template rendering.

For example, there’s a service that’s building a case management system.
Their users are sending emails on a case-by-case basis. Before they
send an email, it’s ressuring to double check that the right data is
being inserted, that the right template is being used, etc.

This commit:
- adds a separate endpoint for previewing a template, with
  personalisation taken from the get parameters of the request
- beefs up the tests around getting a template

Not part of this pull request:
- making this enpoint publicly accessible
2016-06-17 09:19:22 +01:00
Rebecca Law 3766d30d07 Merge pull request #428 from alphagov/rename-tasks-final-deploy
Remove the extra task
2016-06-16 17:43:42 +01:00
Rebecca Law 95c687b649 Merge branch 'master' into refactor-query-filters 2016-06-16 17:39:58 +01:00
Rebecca Law b6c6b25032 Use the send email task to send the password reset and invitation email.
Next PR can remove those tasks.
2016-06-16 17:34:33 +01:00
Adam Shimali db22373a6b Endpoint for reading notification stats for a given day. 2016-06-16 17:02:33 +01:00
Leo Hemsted f7ceaf9009 Merge pull request #426 from alphagov/api-template-response
add template body, version, and subject to send_notification api
2016-06-16 11:36:08 +01:00
Rebecca Law d6e920fa89 Use GOV.UK Notify service to send the forgot password email link using the template to create the message. 2016-06-16 10:43:41 +01:00
Rebecca Law 39c9d9ebe9 Merge branch 'master' into refactor-query-filters
Conflicts:
	app/permission/rest.py
2016-06-16 10:26:17 +01:00
Adam Shimali 92fdba7010 Merge pull request #424 from alphagov/more-error-logging
Make errors return via error handlers in errors.py
2016-06-16 09:34:20 +01:00
Rebecca Law 3c912b6cee Merge branch 'master' into rename-tasks-final-deploy
Conflicts:
	app/celery/tasks.py
2016-06-15 16:49:20 +01:00
Rebecca Law f8262b13c1 Refactor permissions dao - removed custom query filter
Removed permissions rest - not being used.
2016-06-15 16:32:52 +01:00
Adam Shimali c268401554 Updated for pr comments 2016-06-15 16:19:28 +01:00
Rebecca Law 0200d3ab11 Remove the extra task created to handle the change to the send_email signature 2016-06-15 15:28:53 +01:00
Rebecca Law 2fab40a1a5 Merge pull request #423 from alphagov/rename-task
Rename the task so that it is the name we want to use.
2016-06-15 14:53:14 +01:00
Leo Hemsted 2b13033e85 add template body, version, and subject to send_notification api 2016-06-15 14:51:35 +01:00
Adam Shimali b33312b855 Change endpoint responses where there are marshalling, unmarshalling
or param errors to raise invalid data exception. That will cause
those responses to be handled in by errors.py, which will log
the errors.

Set most of schemas to strict mode so that marshmallow will raise
exception rather than checking for errors in return tuple from load.

Added handler to errors.py for marshmallow validation errors.
2016-06-15 14:37:51 +01:00
Rebecca Law e942793521 Rename the task so that it is the name we want to use.
Next deploy will remove the extra task.
2016-06-15 14:11:17 +01:00
Leo Hemsted 5a66884f0e Merge pull request #422 from alphagov/refactor-notification-test-rest
move all send_notification tests to separate file
2016-06-15 13:46:38 +01:00
Leo Hemsted d0eca79417 move all send_notification tests to separate file 2016-06-15 12:27:57 +01:00
Rebecca Law 470bf7281a Merge pull request #420 from alphagov/use-notify-to-send-email-verification-links
Use notify to send email verification links
2016-06-14 17:00:28 +01:00
Rebecca Law 4c34238a88 Fix send_email task requested from notifications endpoint. 2016-06-14 16:53:52 +01:00
Rebecca Law 92e7450d1d Revert after_deploy task to after_success 2016-06-14 16:30:23 +01:00
Rebecca Law 91f64c41c2 Use after_deploy to run functional tests. 2016-06-14 16:11:50 +01:00
Rebecca Law 6c8e108982 Merge pull request #379 from alphagov/remove_twilio_config_variables
Twilio config variables removed.
2016-06-14 15:54:06 +01:00
Rebecca Law a55b44a333 Merge pull request #412 from alphagov/use-notify-to-send-email-verification-links
Safely change task signature - first deploy
2016-06-14 15:42:59 +01:00
Chris Hill-Scott 3b7135f276 Merge pull request #413 from alphagov/filter-job-notifications
Test for filtering a job by notification status
2016-06-14 15:31:24 +01:00
Chris Hill-Scott 7f7743b389 Test for filtering a job by notification status
It’s going to be useful to see all the notifications for a job that are
failed/delivered/etc.

The API seems to support this behaviour already, but it doesn’t seem to
be tested.

This commit adds some testsfor the DAO and REST layers.
2016-06-14 14:07:54 +01:00
Martyn Inglis 0a933021d6 Merge branch 'master' into split-sms-and-retry 2016-06-14 12:55:16 +01:00
Rebecca Law b31c4e801e Remove old email_registration_verification task 2016-06-14 11:43:13 +01:00
minglis 14e2487266 Merge pull request #415 from alphagov/update-notify-from-address
moved migration script from
2016-06-14 09:28:05 +01:00
Martyn Inglis d5259be44c moved migration script from
https://github.com/alphagov/notifications-api/pull/412

To ship it quickly as preview broken without it.
2016-06-14 09:22:07 +01:00
Martyn Inglis f143aade71 Added new tests/code to ensure failure stats recorded 2016-06-13 16:40:46 +01:00