Commit Graph

3865 Commits

Author SHA1 Message Date
pyup-bot
2e43044a0f Update marshmallow-sqlalchemy from 0.13.1 to 0.13.2 2017-10-24 01:17:28 +01:00
Athanasios Voutsadakis
6e6c3c050b Temporary test fix
This should be removed when the SES endpoint is removed
2017-10-23 17:54:46 +01:00
Athanasios Voutsadakis
fe5756a1aa Fix tests 2017-10-23 17:54:45 +01:00
Athanasios Voutsadakis
61b665c908 Update tests 2017-10-23 17:54:45 +01:00
Athanasios Voutsadakis
7611d473b4 We no longer have guaranteed access to a request context 2017-10-23 17:54:45 +01:00
Athanasios Voutsadakis
062084dcc4 Allow for both an endpoint callback and SQS consumption 2017-10-23 17:54:45 +01:00
pyup-bot
b16c855f56 Update notifications-python-client from 4.4.0 to 4.5.0 2017-10-23 17:48:27 +01:00
Rebecca Law
5ce44c07f5 Fix unit tests. 2017-10-23 16:07:10 +01:00
Rebecca Law
f1f2e5cd90 Fix the results to be returned in the same format that the admin app expects. 2017-10-23 15:06:11 +01:00
Chris Hill-Scott
5b3e77ba87 Make missing personalisation error consistent
In other places the text we use for this error message is "Missing personalisation: name, date, thing". See:
- 72b108b694/app/template/rest.py (L125)
- 717c0510a3/app/notifications/rest.py (L206)
- 05a179c6ef/app/v2/template/post_template.py (L38)

For some reason this part of the codebase says "Template missing personalisation: …". This is inconsistent, and also confusing because it’s the API call that’s missing the personalisation, not the template itself. 

This commit changes the error message to be consistent with the majority of the codebase, which uses the less confusing wording.
2017-10-23 14:41:49 +01:00
Chris Hill-Scott
c9a7ee991e Merge pull request #1328 from alphagov/international-default
Make international text messaging on by default for new services
2017-10-23 14:03:16 +01:00
Rebecca Law
bfb8528ea9 The /platform-admin takes a long time, probably because the marshmallow schema used joins to the service table to return all the service data and is inefficient.
The query itself has not been improved much at all but by not using a marshmallow schema I hope to get the performance gain I am looking for.
2017-10-23 10:58:06 +01:00
Sakis
f6cdfdb640 Merge pull request #1330 from alphagov/temporary-syslog-drain
Add syslog drain service to preview and staging
2017-10-20 14:52:02 +01:00
Katie Smith
3072c66d5f Merge pull request #1329 from alphagov/delete-unused-celery-tasks
Remove unused Celery tasks
2017-10-20 14:50:04 +01:00
Rebecca Law
4675b91763 Merge pull request #1325 from alphagov/add-update-multiple-sms-sender
Add update multiple SMS senders for a service
2017-10-20 14:06:53 +01:00
Athanasios Voutsadakis
202a0d008b Add syslog drain service to preview and staging
This should and will be moved back to the approriate manifest-base-*.yml
files when it is configured for production usage.
2017-10-19 17:08:56 +01:00
Rebecca Law
d1c9335307 If the add sms sender is for an inbound number use the number from the inbound number object, rather than the value passed in. 2017-10-19 16:29:54 +01:00
Katie Smith
ce28e84af6 Remove unused tasks
Deleted three Celery tasks (send-email, send-sms and persist-letter).

These are not being used anymore - we replaced them in commit
0c9a4bce59.
2017-10-19 16:17:25 +01:00
Katie Smith
4e1d87bbb4 Merge pull request #1327 from alphagov/create-new-tasks-for-saving-notifications
Add celery tasks- save_sms, save_email, save_letter
2017-10-19 16:08:04 +01:00
Rebecca Law
d975f30888 Fix merge conflict 2017-10-19 14:39:53 +01:00
Rebecca Law
954a80649e Merge branch 'master' into add-update-multiple-sms-sender 2017-10-19 14:34:58 +01:00
Venus Bailey
61bda438a4 Merge pull request #1326 from alphagov/vb-free-sms-limit-history
[#152067121] Create new table annual_billing
2017-10-19 14:33:44 +01:00
venusbb
b0872d9466 add unique service_id&year constraint 2017-10-19 14:21:10 +01:00
Rebecca Law
2193afe9a3 Remove 'data' from the json being returned. 2017-10-19 13:59:22 +01:00
Rebecca Law
cee916c68a As per review commemnts:
- Add the assert to a test - oops.
- Fix typo in error message.
2017-10-19 13:51:33 +01:00
venusbb
7e78e19500 Unique constrain and db.relationship 2017-10-19 12:00:01 +01:00
Chris Hill-Scott
534a2ea7cd Factor permissions tests for code reuse
We had these fiddly little generator expressions repeated throughout
this file. Code is made easier to understand by refactoring them into a
function that describes what it does.
2017-10-19 11:43:28 +01:00
Chris Hill-Scott
46d45d8595 Make international SMS on for new services
International SMS is a mature, documented feature now. There’s no reason
it shouldn’t be available to everyone. If it’s turned off by default
then we’re relying on people finding it in the settings page to know
that it exists (which we found in research the other week that users,
who would have benefitted from having international SMS, were failing to
do).

This also fixes the problem whereby users signing up for Notify with an
international phone number (eg those working abroad for the Foreign and
Commonwealth Office) couldn’t get through the tour because they weren’t
able to send themselves the example text message (see
https://www.pivotaltracker.com/story/show/150705515).
2017-10-19 11:43:27 +01:00
venusbb
b9bae4f264 Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-free-sms-limit-history 2017-10-19 11:28:46 +01:00
Rebecca Law
709e24e267 Added endpoints to get sms senders for a service 2017-10-19 10:43:49 +01:00
Rebecca Law
6dc41c3b47 New endpoints to add and update multiple SMS sender for a service. 2017-10-19 09:58:23 +01:00
Katie Smith
0c9a4bce59 Add celery tasks- save_sms, save_email, save_letter
Created three new celery tasks:
* save_sms          (will replace send_sms)
* save_email        (will replace send_email)
* save_letter       (will replace persist_letter)

The difference between the new tasks and the tasks they are replacing is
that we no longer pass in the datetime as a parameter.

The code has been changed to use the new tasks, and the tests now run
against the new tasks too. The old tasks will need be removed in a separate
commit.
2017-10-18 17:00:37 +01:00
venusbb
6e22a33c42 Fix some problematic code style. 2017-10-18 15:41:00 +01:00
venusbb
b2fa7cdd83 create new table annual_billing 2017-10-18 15:35:51 +01:00
venusbb
5b2912c0f5 create new table annual_billing 2017-10-18 15:09:35 +01:00
Rebecca Law
4ac2dc3606 Fix code style 2017-10-18 13:17:52 +01:00
Rebecca Law
4ca6fbc724 Added dao methods needed to add or update multiple sms senders for a service.
Remove the unique constraint for service on the ServiceSmsSender model.
2017-10-18 13:13:23 +01:00
Rebecca Law
fb85f22c2a Merge pull request #1322 from alphagov/set-accurate-created_at
Set accurate Notification.created_at
2017-10-18 13:10:46 +01:00
Rebecca Law
1a463cba1f Merge branch 'master' into add-update-multiple-sms-sender 2017-10-18 11:18:44 +01:00
Chris Hill-Scott
92b50a26d3 Merge pull request #1298 from alphagov/organisation-type
Store organisation type against each service
2017-10-18 10:56:56 +01:00
Chris Hill-Scott
2a5e6c2d0c Store organisation type against each service
> So that we can default services to their appropriate text allowance,
> we need to find out what sector they're in. So let's start collecting
> that from teams as they create new services.

In order to work out what a team’s allowance should be, we need to know
what part of government they’re from. We’re going to do this logic in
the admin app and then `POST` the allowance to the API.

So all we need to do with the information that the users give us is
store it against the service, so we have a record. Doesn’t need any
logic doing as a result of it, doesn’t need foreign keying to the
organisations table, etc.
2017-10-18 10:49:31 +01:00
Rebecca Law
f52ec2c406 Added an order by to the check_job_status query. The test was failing intermittently 2017-10-18 09:50:39 +01:00
Rebecca Law
edba490c72 Remove unique constraint for ServiceSmsSenders.
This will allow a service to have multiple sms senders.
2017-10-17 16:53:13 +01:00
Rebecca Law
809c5fc055 Remove unique constraint for ServiceSmsSenders.
This will allow a service to have multiple sms senders.
2017-10-17 16:49:50 +01:00
Rebecca Law
baab9dd86f Merge pull request #1321 from alphagov/remove-delivery_status
Removed the _delivery_status endpoint
2017-10-17 16:43:55 +01:00
Rebecca Law
24a87d8260 Small change to use the current datetime stamp for the Notification.created_at timestamp rather than the job.created_at start date. This will give us better more reflective data. 2017-10-17 16:05:31 +01:00
Rebecca Law
5aa37f09b6 Removed the _delivery_status endpoint.
The test this status check was doing does not reflect real traffic of Notify. It is typical for messages to be in 'sending' for a while (people turn off their phone for example).
2017-10-17 15:51:42 +01:00
Leo Hemsted
b384b13213 Merge pull request #1320 from alphagov/leohemsted-patch-1
log json to stdout
2017-10-17 15:44:43 +01:00
Leo Hemsted
bfb54a3b98 Merge pull request #1319 from alphagov/pyup-update-sqlalchemy-utils-0.32.18-to-0.32.19
Update sqlalchemy-utils to 0.32.19
2017-10-17 15:42:33 +01:00
Leo Hemsted
4d7098c5fd Merge pull request #1312 from alphagov/pyup-update-cffi-1.11.0-to-1.11.2
blacklist 1.11.0 and 1.11.2 of cffi
2017-10-17 15:42:16 +01:00