Commit Graph

774 Commits

Author SHA1 Message Date
NIcholas Staples
551f20e839 Merge pull request #258 from alphagov/template_history
Working tests and provider stats table.
2016-04-25 13:38:39 +01:00
Nicholas Staples
b56e324a4c Working tests and provider stats table.
Fix for tests and import error.

Added tests and updated for code review comments.
2016-04-25 12:20:06 +01:00
Rebecca Law
ff61223d97 Merge pull request #257 from alphagov/version-history-tweak
Only record history for specified class
2016-04-22 10:08:21 +01:00
Adam Shimali
d14be2067c When using the versioned decorator I noticed that when adding or
revoking an api key the service it associated with was of course added
to db.session.dirty.

That resulted in an updated version of service being added to the
service history table that showed no visible difference from that
record immediately precending it as the change was to another table,
namely the api_key table. A new api key or revoked api key was correctly
added to api_key and api_key_history tables. However I think an
'unchanged' service history record may be a bit confusing as you'd need
to correlate with api_keys to work out what the change was.

I think it's best to just record the new/revoked api_key and not create
another version of the service.

This pr wraps the exisiting versioned decorator with one that take a
class which you are interested in versioning.

Using the new decorator you only get a new version and history record
for the class you pass to outer decorator.

If the exising behaviour is acceptable to the powers that be then by all
means ignore/close this pr.
2016-04-21 18:10:57 +01:00
Adam Shimali
783271f306 Merge pull request #256 from alphagov/temp-endpoint-for-history
Temp history of endpoint
2016-04-21 17:05:01 +01:00
Adam Shimali
7378352c26 This is a temporary endpoint to get history of service and api key
updates. This will be surfaced on a simple log page on admin app
until product team work out who/how/when etc. of viewing history
data.
2016-04-21 16:32:20 +01:00
Adam Shimali
68eabd0676 Merge pull request #255 from alphagov/api-keys-history
Added version history to api keys.
2016-04-21 15:43:27 +01:00
Adam Shimali
252386c3c9 Changes for pr comments 2016-04-21 15:22:26 +01:00
Adam Shimali
873b8d1312 Reverted commented out tests 2016-04-21 15:15:32 +01:00
Adam Shimali
74ac5b5f30 Added version history to api keys. This needed a bit of change
to create history to handle foreign keys better. There may yet
be a better way of doing this that I have not found yet in sqlalchemy
docs.
2016-04-21 14:47:58 +01:00
NIcholas Staples
a3651c8398 Merge pull request #252 from alphagov/notification_billings_stats
Provider Statistics added.
2016-04-21 14:02:21 +01:00
Nicholas Staples
3b1423a2ea Provider Statistics added.
Rates command added with a test.

Updated to include added migration.
2016-04-21 13:47:04 +01:00
Adam Shimali
a38e4f4965 Merge pull request #249 from alphagov/notification-stats-date
Changed notifications stats day column to date type from string.
2016-04-20 15:54:33 +01:00
Adam Shimali
054d8baa0a Changed notifications stats day column to date type from string. 2016-04-20 15:38:06 +01:00
Rebecca Law
794e922d94 Merge pull request #248 from alphagov/mmg-client-fix
Update MMG responses so that 3 is success.
2016-04-20 14:45:08 +01:00
Rebecca Law
9a25062943 Update mmg responses so that 3 is success.
Status codes from mmg are:
2: UNDELIVERABLE Message is undeliverable.
3: DELIVERED Message is delivered.
4: EXPIRED Message is expired.
5: REJECTED Message is rejected.
2016-04-20 14:29:31 +01:00
NIcholas Staples
abdbdc7335 Merge pull request #247 from alphagov/add_context_to_auth_code
Updated text send to user for the authorization code.
2016-04-20 12:08:11 +01:00
Nicholas Staples
bee23281fc Updated text send to user for the authorization code. 2016-04-20 12:02:17 +01:00
Rebecca Law
7187ba6dc7 Merge pull request #242 from alphagov/mmg-client-fix
Update to processing the the response from MMG
2016-04-20 11:27:37 +01:00
Rebecca Law
f283379646 Defend against status code 00 or 0 from mmg 2016-04-20 11:07:21 +01:00
Chris Hill-Scott
2883b220b7 Merge pull request #244 from alphagov/fix-missing-import
Fix missing import on notification stats endpoint
2016-04-20 10:35:23 +01:00
Chris Hill-Scott
425cc8340e Fix missing import on notification stats endpoint
The response import was missing, which broke things.

There was no test to catch this.

This commit adds a rudimentary test to make sure that the endpoint
doesn’t 500, at the very least.
2016-04-20 10:33:41 +01:00
Chris Hill-Scott
85d5c656f8 Merge pull request #241 from alphagov/get-notification-stats-last-7-days
Allow filtering of notification stats by days
2016-04-20 10:07:17 +01:00
Rebecca Law
41ce691704 Update to processing the the response from MMG
MMG changed the datatype and the status codes they send us for the delivery receipts.
This PR accounts for that change.
2016-04-20 09:45:13 +01:00
Adam Shimali
6ef8bb5ada Merge pull request #236 from alphagov/record-service-history
A slightly manual way of recording history.
2016-04-19 17:18:19 +01:00
Adam Shimali
8ea8bba612 Fix migration downgrade 2016-04-19 17:13:26 +01:00
Adam Shimali
a6a18c1a6f This approach uses part of sqlalchemy example history_meta code
adapted to recording inserts and updates.

This removes need to manually create history tables.

Our code still remains in control of when history records are
created.
2016-04-19 17:13:26 +01:00
Chris Hill-Scott
9c2c9435e3 Allow filtering of notification stats by days
https://www.pivotaltracker.com/story/show/117920839

On the dashboard we want to show counts of notifications sent in the
last 7 days, plus today. So the API enpoint needs to accept an argument
to limit how many days worth of statistics it will return.

This is a bit fiddly at the DAO level because the date is just stored as
a string.
2016-04-19 16:44:19 +01:00
NIcholas Staples
16553af133 Merge pull request #238 from alphagov/add_page_size_parameter
Added page_size parameter for notifications api. All tests passing.
2016-04-19 14:46:54 +01:00
Nicholas Staples
31978bd987 Added page_size parameter for notifications api. All tests passing.
Add page_size and total parameters to all calls for notifications.
2016-04-19 11:26:21 +01:00
NIcholas Staples
58ab831df9 Merge pull request #229 from alphagov/process_email_subject_placeholders
Character count added and tests passing.
2016-04-18 16:16:10 +01:00
NIcholas Staples
d59cf0133c Merge pull request #235 from alphagov/mmg_bug_fix
Added multi parameter for sending messages.
2016-04-18 16:16:00 +01:00
Rebecca Law
bcb031259c Revert "Update master with all the staging changes for aws deployments."
This reverts commit bfb59811f4.
2016-04-18 14:07:54 +01:00
Nicholas Staples
15c4fb47f7 Added multi parameter for sending messages. 2016-04-18 09:55:56 +01:00
Rebecca Law
a96d2b5e4a Merge pull request #232 from alphagov/aws-fixup
Update master with all the staging changes for aws deployments.
2016-04-15 16:42:42 +01:00
Nicholas Staples
f681d40366 Character count added and tests passing.
Remove sql restriction for count to not be null.
2016-04-15 16:31:13 +01:00
Rebecca Law
bfb59811f4 Update master with all the staging changes for aws deployments. 2016-04-15 16:10:11 +01:00
Rebecca Law
966a662513 Merge branch 'master' of github.com:alphagov/notifications-api 2016-04-15 14:51:35 +01:00
Rebecca Law
86104f7e56 Fix deployment group names 2016-04-15 14:51:12 +01:00
Chris Hill-Scott
a6f78ecdbd Merge pull request #225 from alphagov/unlink-govuk
Stop GOV.UK becoming a link in email clients
2016-04-15 13:34:06 +01:00
Chris Hill-Scott
02f903b44c Stop GOV.UK becoming a link in email clients
Implements (and depends on)
https://github.com/alphagov/notifications-utils/pull/24

Works for:
- emails we send to users, eg invite, forgot password
- email templates that users have created
2016-04-15 12:33:58 +01:00
Rebecca Law
9eb895a98b Merge pull request #226 from alphagov/simplify-jwt
Simplify jwt
2016-04-15 12:05:15 +01:00
Rebecca Law
c9761cd58a remove unused import 2016-04-15 10:59:00 +01:00
Rebecca Law
282a62e636 Use the new version of the notifications-python-client. This version no longer adds the req and pay to the claims of the jwt.
The change is backward compatible so an older client that sends a jwt with the extra claims will pass authentication.
Once all the clients have been updated to not include the extra claims some updates to exclude them from the method signatures will happen as well.
2016-04-14 18:12:33 +01:00
NIcholas Staples
b9ca7c239a Merge pull request #221 from alphagov/process_email_subject_placeholders
Working placeholders in subject with upgraded notifications-utils.
2016-04-13 16:04:42 +01:00
Nicholas Staples
1b76646170 Working placeholders in subject with upgraded notifications-utils.
Fix test.
2016-04-13 15:53:27 +01:00
NIcholas Staples
3c4c9c18dc Merge pull request #219 from alphagov/fix_delete_successful_bug
Fixed bug with deleting the 'delivered' notifications.
2016-04-13 12:54:38 +01:00
Nicholas Staples
7fa33a52a9 Fixed bug with deleting the 'delivered' notifications. 2016-04-13 12:49:38 +01:00
Rebecca Law
cf883ed339 Merge pull request #217 from alphagov/update_uuid_all_db_models
Update uuid all db models
2016-04-13 11:59:40 +01:00
Chris Hill-Scott
19b3a53499 Merge pull request #218 from alphagov/order-templates-updated
Order templates by last updated date
2016-04-12 15:26:20 +01:00