Commit Graph

3569 Commits

Author SHA1 Message Date
Katie Smith
dede336b3b Update tests to not use letter contact block from services table
A few test updates were needed after rebasing onto master.
2017-10-03 13:35:09 +01:00
Imdad Ahad
cb37ba5f78 Update schema to return default letter contact for a service 2017-10-03 10:31:21 +01:00
Imdad Ahad
4eebd9a83c Remove the letter_contact_block from the Service model 2017-10-03 10:31:21 +01:00
Imdad Ahad
d21d9cabd1 Use new default letter contact in the DVLA celery task 2017-10-03 10:31:15 +01:00
Venus Bailey
84d7e93b9b Merge pull request #1289 from alphagov/vb-platform-admin-api
admin to api not passing trial_mode_service
2017-10-02 16:39:07 +01:00
Katie Smith
9d26e28c82 Merge pull request #1278 from alphagov/imdad-katie-migrate-data-letter-contact
[3/4] - Populate service_letter_contacts from existing data
2017-10-02 15:07:31 +01:00
venusbb
9a5addb896 Reverse codes that uses filtering of trial mode services 2017-10-02 12:00:52 +01:00
Imdad Ahad
1dd3298290 Add command to populate new service letter contact table from existing data 2017-10-02 11:46:19 +01:00
Chris Hill-Scott
2614d719d1 Merge pull request #1264 from alphagov/template-returns-placeholders
Return placeholders when getting a template
2017-10-02 11:21:46 +01:00
Katie Smith
f90a10ab38 Merge pull request #1277 from alphagov/imdad-katie-store-multiple-letter-contacts
[2/4] Upsert into ServiceLetterContact table when updating a service
2017-10-02 10:23:20 +01:00
Leo Hemsted
a74db5a80b Merge pull request #1280 from alphagov/letter-api-not-by-job
Letter api not by job
2017-09-28 10:55:58 +01:00
Venus Bailey
e2bf6fde67 Merge pull request #1284 from alphagov/vb-inbound-sms-ip
Inbound sms ip messages
2017-09-28 10:20:31 +01:00
venusbb
eb840585a7 Inbound sms ip messages 2017-09-28 10:17:59 +01:00
Venus Bailey
9a1aedec43 Merge pull request #1279 from alphagov/vb-inbound-sms-ip
Enable Inbound sms IP blocking
2017-09-27 12:07:24 +01:00
venusbb
9ad75ff726 Tests modified 2017-09-27 10:15:29 +01:00
venusbb
8f76338c7b Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-inbound-sms-ip 2017-09-27 10:00:42 +01:00
Rebecca Law
af48e336b5 Merge pull request #1276 from alphagov/migrate_service_sms_senders
Migration for Service SMS senders
2017-09-27 09:46:31 +01:00
Leo Hemsted
c97b130540 test dvla callback update tasks 2017-09-26 12:36:42 +01:00
Leo Hemsted
18ed90158e add tests for new noti dao function 2017-09-26 12:16:33 +01:00
Leo Hemsted
aaadf09562 add tests for new sched task 2017-09-26 12:03:06 +01:00
Leo Hemsted
b1928b928c update process_letter tests 2017-09-26 11:28:54 +01:00
venusbb
6a7013fa7a Enable Inbound sms IP blocking 2017-09-26 10:59:09 +01:00
Leo Hemsted
f3db920c71 remove jobs from letter api calls
we now no longer create a job. At the end of the post there is no
action, as we don't have any tasks to queue immediately - if it's a
real notification it'll get picked up in the evening scheduled task.

If it's a test notification, we create it with an initial status of
sending so that we can be sure it'll never get picked up - and then we
trigger the update-letter-notifications-to-sent-to-dvla task to sent
the sent-at/by.
2017-09-26 09:57:36 +01:00
Leo Hemsted
daf1dc4dca fix bucket names and change crontab param order for clarity 2017-09-26 09:57:36 +01:00
Leo Hemsted
5e230943c4 remove trailing comma from CELERY_ENABLE_UTC, a beat config option
To run beat after this, you must remove the celerybeat-schedule file from your notifications-api
project root
2017-09-26 09:57:36 +01:00
Leo Hemsted
cdc8acb49a only trigger DVLA tasks if there is data to send 2017-09-26 09:57:36 +01:00
Leo Hemsted
04412fd314 update queue name 2017-09-26 09:57:35 +01:00
Leo Hemsted
17ba8db97f remove jobs from letter api and make success/error ftp callback tasks
1. No longer create jobs when creating letters from api 🎉
2. Bulk update notifications based on the notification references after
   we send them to DVLA - either as success or as error
2017-09-26 09:57:35 +01:00
Leo Hemsted
7dd3c1df5a set letter notifications to pending while notify-ftp does its stuff
this means that if the task is accidentally ran twice (eg we autoscale
notify-celery-worker-beat to 2), it won't send letters twice.

Additionally, update some function names and config variables to make
it clear that they are referring to letter jobs, rather than all letter
content
2017-09-26 09:57:35 +01:00
Leo Hemsted
f61ccd8ff0 add run_letter_notifications scheduled task
this task grabs all notifications that are sent via the API, and
are still in created - and sends them off to DVLA.
2017-09-26 09:57:35 +01:00
Sakis
c36ced5b56 Merge pull request #1274 from alphagov/configure-gunicorn-errorlog
Configure gunicorn errorlog
2017-09-26 09:53:27 +01:00
Athanasios Voutsadakis
f32a243e47 Change .info to .error 2017-09-25 16:24:35 +01:00
Imdad Ahad
f0784109a1 Upsert into letter contact table when updating a service's letter contact block 2017-09-25 16:01:24 +01:00
Imdad Ahad
3977574ef1 Add methods to add/update letter contacts for a service that handle defaults properly 2017-09-25 15:46:01 +01:00
Rebecca Law
0fa16cc9d1 Merge pull request #1270 from alphagov/select-inbound-number-to-assign
Select an inbound number for a service
2017-09-25 14:17:36 +01:00
Imdad Ahad
fa3f4f3c20 Add dao to store letter contacts and upsert 2017-09-25 12:26:29 +01:00
Venus Bailey
e355c870d0 Merge pull request #1275 from alphagov/vb-platform-admin-api
Platform Admin Timeout problem
2017-09-25 12:10:48 +01:00
Rebecca Law
b195257d94 Added another test 2017-09-25 11:14:29 +01:00
Rebecca Law
64db8cb18d Merge branch 'master' into select-inbound-number-to-assign 2017-09-25 11:13:12 +01:00
venusbb
34430ac97e tidy up codes and tests 2017-09-25 09:44:16 +01:00
Chris Hill-Scott
55d185f50d Return metadata about placeholders
In the future, we may want to return additional information about
placeholders.

We came up with three possible formats:
1. list of `dict`s, eg `[{'name': 'first name', 'required': True}]`
2. `dict` of `list`s, eg `{'required': ['first name']}`
3. `dict` of `dict`s, eg `{'name': {'required': True}}`

I don’t like 1. because it’s harder to traverse if all you want is the
name of the placeholders, and suggests that you could have two
placeholders with the same name (which you can’t). I don’t like 2.
because it only lets the data be sliced by one dimension (unless the
inner lists aren’t exclusive, in which case you’d need to filter
duplicates when just listing placeholders).

I think 3. has the two advantages of:
- represents that personalisation is unique, ie you can’t pass back in
  two different values for the same key
- is forward compatible, ie we can add many more properties of a
  placeholder without breaking anything

So this commit implements 3.
2017-09-22 16:42:16 +01:00
Rebecca Law
f2928e6c55 Migration server command to create one row in Service_sms_senders for each service. 2017-09-22 16:27:23 +01:00
venusbb
35cb7a0556 inserted missing codes 2017-09-22 15:52:11 +01:00
venusbb
4e991c26a2 Progress: Filtered day completed 2017-09-22 15:39:53 +01:00
Athanasios Voutsadakis
291071273e Fix PEP8 2017-09-22 15:34:43 +01:00
Athanasios Voutsadakis
646290e2c4 Implement worker_abort server hook
Also update the manifest command to pass the config file in as a parameter
and modify the logs agent to start shipping the error log to cloudwatch
2017-09-22 15:03:45 +01:00
Athanasios Voutsadakis
01611c1936 Configure gunicorn error log file 2017-09-22 11:28:55 +01:00
venusbb
da21248dcf Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-platform-admin-api 2017-09-22 11:14:09 +01:00
venusbb
d59a1f447a Progress: Today stats completed 2017-09-22 11:05:36 +01:00
Rebecca Law
9a1410f48d Merge pull request #1273 from alphagov/add-order-by
Add order by in the dao_get_reply_to_by_service_id()
2017-09-22 10:31:33 +01:00