Commit Graph

2411 Commits

Author SHA1 Message Date
Martyn Inglis
803c21865b Allow rate limiting on a per env basis
- switched off on prod by default
2017-04-25 09:54:09 +01:00
Martyn Inglis
926b8a60f9 Adds in call to new rate limit method in the redis client
- both V1 and V2 APIs
- Rate limiting wrapped into a new method - check_rate_limiting
	- delegates to the previous daily limit and the new though put limit
- Rate limiting done on key type. Each key has it's own limit (number of requests) and interval (time period of requests)
- Configured in the config. Not done on a per-env basis though could be in the future.
2017-04-24 14:15:08 +01:00
Imdad Ahad
6c703840c2 Merge pull request #908 from alphagov/feat-prepare-formatted-csv-notification
Make API responsible formatting notifications for CSV
2017-04-21 13:01:20 +01:00
Imdad Ahad
49fb4823e3 Refactor tests 2017-04-21 11:07:45 +01:00
Leo Hemsted
4a82230eaa Merge pull request #909 from alphagov/revert-906-dvla-orgs
Revert "add DVLA organisations to API"
2017-04-20 18:23:49 +01:00
Leo Hemsted
c3e56d5d2d Revert "add DVLA organisations to API" 2017-04-20 18:21:56 +01:00
Leo Hemsted
95b3248a5e Merge pull request #906 from alphagov/dvla-orgs
add DVLA organisations to API
2017-04-20 17:41:27 +01:00
Leo Hemsted
76676280ab add create service tests for dvla_org 2017-04-20 17:22:45 +01:00
Leo Hemsted
f127bac600 add GET /dvla_organisation endpoint 2017-04-20 15:35:31 +01:00
Imdad Ahad
4dfd5448ad Make get all notications return in csv format too:
* This adds functionality (via an extra req param) to the
* existing get all notifications method allowing us to specify
* when we want the API to return in csv/non-csv format
2017-04-20 12:31:49 +01:00
Chris Hill-Scott
5720f056ee Pass DVLA organisation ID through to Template
So that we know which organisation ID to spit out in the file.
2017-04-20 12:06:51 +01:00
Imdad Ahad
9fbd43c072 Serialise notifications for csv separately:
* Introduces separate method on Notification to serialise the notification
* ready for csv output
* Fixes issue where job_row_number = 0 not being accounted for correctly
2017-04-20 11:52:00 +01:00
Leo Hemsted
d514d99a67 add DVLA organisations to API
when services are created, they'll have a dvla_org_id of 001, or
HM Government. That can be changed later using a regular update call
2017-04-19 16:31:18 +01:00
Leo Hemsted
67002cd608 Merge pull request #905 from alphagov/letter-scheduled-task
exclude letters from scheduled cleanup tasks
2017-04-19 16:19:44 +01:00
Leo Hemsted
935e566284 add tests for letters not getting excluded 2017-04-19 14:22:25 +01:00
kentsanggds
45a689f98e Merge pull request #904 from alphagov/remove-slash-in-route
Removed slash from v2 get all templates route
2017-04-19 12:52:04 +01:00
Ken Tsang
4a63a337b2 Removed slash from v2 get all templates route 2017-04-19 12:38:58 +01:00
Leo Hemsted
b381aeefa1 don't include letters when timing out/deleting old notifications
also refactored those functions, since they were pretty gnarly and
repeated themselves a lot
2017-04-19 11:34:00 +01:00
kentsanggds
d51fbf49e6 Merge pull request #903 from alphagov/add-v2-template-get-all
Add v2 template get all
2017-04-19 11:09:57 +01:00
Ken Tsang
fc0cfa5dbf Corrected code to handle template types 2017-04-19 10:51:12 +01:00
Ken Tsang
ed953e992d Add check for subject when email type 2017-04-19 10:51:12 +01:00
Ken Tsang
c33b876c66 Remove get all template print 2017-04-19 10:51:12 +01:00
Ken Tsang
5ef0ecf9bf Added subject to get all templates email template 2017-04-19 10:51:12 +01:00
Ken Tsang
a5e514c356 Refactored to use template response as template 2017-04-19 10:51:12 +01:00
Ken Tsang
d290a2e0ad Removed paging from get all templates 2017-04-19 10:51:12 +01:00
Ken Tsang
e2ad8ba50d Renamed get template test 2017-04-19 10:51:12 +01:00
Ken Tsang
cb7cd233d1 Rrefactored schema 2017-04-19 10:51:12 +01:00
Ken Tsang
89e244ccd2 First commit 2017-04-19 10:51:12 +01:00
Ken Tsang
f5da3574b5 Add get all templates schema 2017-04-19 10:51:12 +01:00
minglis
ddda2bd158 Merge pull request #902 from alphagov/task-to-set-job-to-error
Task to set job to error
2017-04-18 16:07:32 +01:00
minglis
2d4bcde0a8 Merge pull request #901 from alphagov/update-the-notification-with-dvla-id
Added the random string reference to the letter
2017-04-18 15:12:55 +01:00
Martyn Inglis
2b4043515f fixed tests that used the new state. 2017-04-18 14:40:48 +01:00
Martyn Inglis
5081ffc675 roll error jobs into finished state - unsure where to go with these as these have failed, but this leaves them nowhere to go.
Making them finished and the whole job can be re-done.
2017-04-18 14:40:33 +01:00
Martyn Inglis
8956338d31 Add a new task to update a job to error - note it leaves the notifications in whatever state they were in. 2017-04-18 11:42:48 +01:00
Martyn Inglis
6a0efd80ab Add a new status to the job statuses to handle errors. 2017-04-18 11:42:21 +01:00
Martyn Inglis
81f0942f57 Merge branch 'master' into update-the-notification-with-dvla-id
Conflicts:
	requirements.txt
2017-04-18 11:21:26 +01:00
Martyn Inglis
739ff2dceb Extra test on personilisation block 2017-04-18 11:07:11 +01:00
Martyn Inglis
d6fc2335e6 Latest utils 2017-04-13 12:52:56 +01:00
Martyn Inglis
1894c96f3a updated test to use random string not numeric id formats 2017-04-13 12:52:49 +01:00
Martyn Inglis
b8cfaf02f6 Ordered the query - ambiguous orders made tests flaky 2017-04-13 12:52:30 +01:00
Chris Hill-Scott
f0811ca55e Merge pull request #900 from alphagov/bump-utils-dvla-output
Bump utils to fix problems with our output to DVLA
2017-04-13 10:30:14 +01:00
Chris Hill-Scott
78825db160 Bump utils to fix problems with our output to DVLA
Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/148
2017-04-13 09:10:27 +01:00
Martyn Inglis
b0e5062df2 Added the random string reference to the letter
- uses the reference field on the notifications table to store a 16char random string used to cross reference DVLA letters back to the notification
- used as letter barcode does not have space for a UUID notification id

Depends on https://github.com/alphagov/notifications-utils/pull/149

Renamed the numeric_id to notification_reference in utils and changed validation rules to match this

Note also the persist_notification method set "reference" to be "client_reference" which is confusing and they are different things, so fixed this too.
2017-04-12 17:56:55 +01:00
Rebecca Law
7a891ab857 Merge pull request #899 from alphagov/update-utils
Reduce boto logging level.
2017-04-11 17:40:21 +01:00
Rebecca Law
b5368d296f Reduce boto logging level.
Update notifications-utils to version 15.1.1 in the hopes that the new logging level for s3tranfer will stop the boto logging of the letters body.
But I can only test this on preview.
2017-04-11 17:28:35 +01:00
kentsanggds
39ed760708 Merge pull request #898 from alphagov/update-letter-jobs
Update letter jobs
response changed to 201
2017-04-11 17:07:12 +01:00
kentsanggds
50ee6d98cd Merge pull request #892 from alphagov/v2-preview-subject-personalisation
V2 preview subject personalisation
2017-04-11 17:05:23 +01:00
Ken Tsang
c1ae3369a6 Update test for 201 response from send_letter_jobs 2017-04-11 16:53:30 +01:00
Ken Tsang
8792461998 Changed response to 201 for send_letter_jobs 2017-04-11 16:42:08 +01:00
Ken Tsang
ccd25382ea Refactored post template 2017-04-11 16:37:30 +01:00