Commit Graph

25 Commits

Author SHA1 Message Date
Ken Tsang
b04d01ba27 Refactored code to use new service permissions only 2017-07-06 12:27:55 +01:00
Leo Hemsted
3744463296 treat 40604 and GOVUK as not having a sender ID
in prep for removing the 40604-as-default, first we need to make sure
that if you either have GOVUK or None as your sms sender, then we send
GOVUK through to the provider
2017-05-22 17:10:07 +01:00
Martyn Inglis
caed193647 Use the new task wrapper methods rather than creating a task directly 2017-05-09 18:17:55 +01:00
Imdad Ahad
e450f15b2b Fix typo and update test now that we expect sent for international 2017-04-27 16:57:04 +01:00
Martyn Inglis
349fb3529e Handle case for international SMS - use correct phone validator, and also set status correctly.
This relies on some other code so this commit has placeholder failing tests to be populated when other PRs are merged.
2017-04-27 16:27:14 +01:00
Martyn Inglis
109b1727f2 Fish out the international provider if needed. 2017-04-27 12:14:22 +01:00
Imdad Ahad
d0978e52fb Use intl provider for int sms notifications (needs tests) 2017-04-27 10:18:28 +01:00
Rebecca Law
c36d61c071 Update as per comments on review 2017-02-06 16:20:44 +00:00
Rebecca Law
4085594a53 Small refactor to reuse code. 2017-02-03 14:27:04 +00:00
Rebecca Law
dab89969cc If the service is inactive at the time of sending the notification to the provider, the notification is marked as technical-failure.
Removed the /service/<id>/deactivate endpoint, now using /service/<id>/archive
2017-01-31 14:28:25 +00:00
Rebecca Law
fde3216f9e Check the service is active before sending the notification to the provider. 2017-01-31 13:53:13 +00:00
Martyn Inglis
71289d36db Change to research mode.
Previously research mode created a task to fake the callback from the providers. This meant there is an extra task for each notification than would be generated in a live situation.

This PR changes that, so that a research mode/test key notification calls the callback API rather than make a task to do that .

This ensures that the flow for research mode more closely mimics that of live, and removes a task from the process so we can more accurately test throughput,
2017-01-24 14:24:58 +00:00
Imdad Ahad
e1d1769345 Refactor to switch properly when providers have equal priority with test 2017-01-23 13:36:04 +00:00
Imdad Ahad
0a277b26b6 Switch providers ONLY on provider exception 2017-01-20 16:14:29 +00:00
Leo Hemsted
d4f23f1e44 don't use cloudfront on preview or staging
cloudfront caching isn't set up on those environments yet, so continue
to use flask for now - in the future we'll want to revert this once
those environments are up and running properly
2016-12-29 12:15:47 +00:00
Leo Hemsted
9e27574298 Merge pull request #779 from alphagov/switch-to-cloudfront
use cloudfront instead of flask to serve static images
2016-12-29 11:35:05 +00:00
Leo Hemsted
5cbe4eb5b2 use cloudfront instead of flask to serve static images
branding in emails was previously hosted from admin app - this changes
the url to be static.{domain}/images instead of {domain}/static/images,
which redirects to cloudfront.

some manipulation of the URL was required to make sure it still serves
locally rather than returning "static.localhost:6012" for example.

(if ADMIN_BASE_URL is localhost it just returns the old /static/
path)

also was able to remove DB interaction from a test. woo!
2016-12-21 16:35:16 +00:00
Martyn Inglis
2d946736e0 Log notification ID on deliver tasks and in clients.
- help tie things together  in Kibana.
2016-12-20 13:24:08 +00:00
Chris Hill-Scott
59af44d7ab Update utils to 12.0.0
Includes:

- [x] https://github.com/alphagov/notifications-utils/pull/94 (breaking
      changes which are responsible for all the changes to the API in
      this PR)

The test for `get_sms_fragment_count` has been removed because this
method is already tested in utils here:

ac20f7e99e/tests/test_base_template.py (L140-L159)
2016-12-13 10:57:01 +00:00
Chris Hill-Scott
d449475dd5 Incorporate breaking utils changes
The `.replaced…` methods on instances of `Template` were removed in
https://github.com/alphagov/notifications-utils/pull/84
2016-12-02 10:42:11 +00:00
Martyn Inglis
6f7dd149e2 Tidied up pull request comments 2016-09-23 15:59:23 +01:00
Martyn Inglis
137aa1e2d2 Merge branch 'master' into refactor-send-tasks-into-shared-code
Conflicts:
	app/celery/provider_tasks.py
	tests/app/celery/test_provider_tasks.py
2016-09-23 09:54:53 +01:00
Martyn Inglis
2f36e0dbcf Refactor to make the new send_to_provider methods take a notification not a notification ID.
- Driven by the fact we won't know the type in the API call
- hence we need to load notification earlier , so pass it not the id through to the send task to avoid loading it twice.
2016-09-22 09:16:58 +01:00
Martyn Inglis
991cc884b4 Refactoring the send to provider code out of the tasks folder
- building a rest endpoint to call that code to compliment the existing task based approach.
2016-09-21 13:27:32 +01:00
Martyn Inglis
bd06b18684 Refactor of celery tasks.
- Aim to move the code that contacts providers into it's own module.
- Celery tasks now call this module to send to provider
- No exceptions caught in the new module. Celery tasks now use any exception to trigger a retry.
- tests moved about - new test directory for the new class, all tests from celery test module moved, excepting the retry logic.
2016-09-20 17:24:28 +01:00