Rebecca Law
fe80d785f9
Merge pull request #474 from alphagov/notification-created-status
...
Notification created status
2016-06-27 15:45:14 +01:00
Rebecca Law
b3fabae958
Merge and codestyle
2016-06-27 15:38:25 +01:00
Rebecca Law
6626771335
Merge branch 'master' into notification-created-status
2016-06-27 15:36:42 +01:00
Rebecca Law
3346582634
Fix codestyle
2016-06-27 15:32:26 +01:00
Rebecca Law
90e8154700
Added a test that the message is not sent if the status of the notification is not created.
2016-06-27 15:23:23 +01:00
Rebecca Law
8435217808
Fix new test for the default status of a notification
2016-06-27 15:02:53 +01:00
Leo Hemsted
523215c8fa
Merge pull request #473 from alphagov/api-key-type
...
key_types table
2016-06-27 15:02:52 +01:00
Rebecca Law
48e64abd81
Merge branch 'master' into notification-created-status
2016-06-27 14:59:56 +01:00
Rebecca Law
8a0211b3eb
Only send to the provider if the notification has a created status.
...
If the notification ends up in the retry queue and the delivery app is restarted the notification will get sent twice.
This is because when the app is restarted another message will be in the retry queue as message available which is a
duplicate of the one in the queue that is a message in flight.
This should complete https://www.pivotaltracker.com/story/show/121844427
2016-06-27 14:47:20 +01:00
Leo Hemsted
9eedb19fd4
default to KEY_TYPE_NORMAL to ensure backwards compatibility
...
also cleaned up tests around api_keys - fixed imports, reduced fixture usage
and added an additional (temporary) test for default test type
2016-06-24 16:33:51 +01:00
Leo Hemsted
e9482c7fe1
add new key_type table
...
* single-column static data table that currently contains two types: 'normal' and 'team'
* key_type foreign-keyed from api_keys
- must be not null
- existing rows set to 'normal'
* key_type foreign-keyed from notifications
- nullable
- existing rows set to null
* api_key foreign-keyed from notifications
- nullable
- existing rows set to null
2016-06-24 15:56:54 +01:00
Leo Hemsted
f371c393a2
rename renew_api_key to create_api_key
2016-06-23 16:44:57 +01:00
Adam Shimali
abbd106212
Merge pull request #469 from alphagov/notifications-body-bug-fix
...
Body of notification without placeholder should have been present.
2016-06-23 16:05:38 +01:00
Adam Shimali
0e2e99f64e
notifications_utils Template constructor accepts None for
...
personalisation data therefore None check not needed.
If personalisation is None in in db it will get passed through to
template which returns content.
2016-06-23 15:35:35 +01:00
Adam Shimali
3423c0c44d
Added subject for email templates
2016-06-23 15:21:03 +01:00
Adam Shimali
f65b86cfc9
Body of notification without placeholder should have been present.
2016-06-23 10:25:07 +01:00
Adam Shimali
ed5bdb7be8
Merge pull request #467 from alphagov/notification-created-status
...
Notification created status for send_sms
2016-06-23 10:21:43 +01:00
Rebecca Law
8f19ad19f8
Stop sending the encrypted message to the send_sms_to_provider task.
...
Everything the task needs is now stored in the db.
2016-06-23 09:41:21 +01:00
Leo Hemsted
edd920769c
Merge pull request #459 from alphagov/replaced-subjects
...
Replaced subjects
2016-06-22 17:06:18 +01:00
Rebecca Law
02e37dee3a
Merge branch 'master' into notification-created-status
2016-06-22 16:58:33 +01:00
Leo Hemsted
4ce26dc1a4
Merge pull request #463 from alphagov/test-refactor
...
Remove db.drop_all from notify_db session fixture to speed up tests
2016-06-22 16:53:06 +01:00
Leo Hemsted
c92138d5ab
return replaced subject back from get notifications API
2016-06-22 16:24:34 +01:00
Rebecca Law
11ac7b2874
Merge branch 'master' into notification-created-status
...
Conflicts:
app/dao/notifications_dao.py
2016-06-22 16:15:56 +01:00
Rebecca Law
5f29815870
Merge pull request #464 from alphagov/refactor-api-key
...
Refactor the api_key_dao.
2016-06-22 15:57:38 +01:00
Leo Hemsted
93618d2a7e
make test db return order-agnostic
2016-06-22 15:56:41 +01:00
Rebecca Law
2e63a7e2af
Merge pull request #462 from alphagov/allow-created-notifications-to-be-updated
...
Added created as a status type that can be updated.
2016-06-22 15:56:41 +01:00
Rebecca Law
acee87fc63
Refactor the api_key_dao.
...
The only update we should be doing to an api key is to expire/revoke the api key.
Removed the update_dict from the the save method.
Added an expire_api_key method that only updates the api key with an expiry date.
2016-06-22 15:27:28 +01:00
Leo Hemsted
bffeaa773a
Remove db.drop_all from notify_db session fixture to speed up tests
...
We were dropping all tables at the end of the test run, however the alembic_version table is not part of the metadata so was being persisted. Alembic then doesn't upgrade the database next test run, since the version appears up to date, so we were, in the notify_db_session fixture, recreating from MetaData (sqlalchemy models). This involves quite a costly comparison of the postgres system tables and the tables in models.py, which was adding half a second to each test that uses the notify_db_session fixture (virtually all of them).
2016-06-22 15:22:16 +01:00
Rebecca Law
23dfa2d535
Added created as a status type that can be updated.
2016-06-22 14:42:55 +01:00
Rebecca Law
fcb5ca9ef4
The send_sms task will created the notification with a status = created.
...
The encrypted_notification for the send_sms_to_provider task has been made optional.
2016-06-22 13:32:27 +01:00
Rebecca Law
1659b64f9e
Merge pull request #458 from alphagov/fix-downgrade
...
Fix downgrade to work if any notifications have status = 'created'
2016-06-21 16:09:12 +01:00
Rebecca Law
7f4d048d75
Fix downgrade to work if any notifications have status = 'created'
2016-06-21 15:55:39 +01:00
Rebecca Law
3d3bff25a8
[WIP] updating notification to start in the created status
2016-06-21 15:51:30 +01:00
Leo Hemsted
5cd3043fc5
return replaced subject back from send_notification API
2016-06-21 15:03:33 +01:00
Rebecca Law
b17aaaabfb
Set a notification.status=created in the send_sms task
2016-06-21 14:38:17 +01:00
Rebecca Law
fa20e67941
Merge pull request #457 from alphagov/notification-created-status
...
Add created as a status for notifications
2016-06-21 13:56:53 +01:00
Rebecca Law
131b0cb017
Merge pull request #452 from alphagov/move-scheduler-tasks
...
Move scheduler tasks
2016-06-21 13:56:40 +01:00
Rebecca Law
8caa688bf5
Add created as a status for notifications
2016-06-21 13:41:46 +01:00
Rebecca Law
2a9a8ae70e
remove print in test
2016-06-21 11:28:18 +01:00
Rebecca Law
6c81d0f465
Merge branch 'master' into move-scheduler-tasks
...
Conflicts:
tests/app/celery/test_tasks.py
2016-06-21 11:24:26 +01:00
Adam Shimali
4cb67e8767
Merge pull request #454 from alphagov/store-notification-personalisation
...
Store personalisation with notification
2016-06-21 10:57:14 +01:00
Adam Shimali
731bb19a9c
Template and personalisation content is now merged and returned with
...
notifications, when retrieved by notification id, or service id (i.e.
all notifications for service).
There is a new element returned at top level of notification json called
body, which is the template content merged with personalisation. This
is consistent with api to endpoint to create notification which returns
what was sent as 'body' in json response.
Merging of template with personalisation is done in the
NotificationStatusSchema.
Personalisation data in encrypted before storing in db.
2016-06-20 16:49:17 +01:00
Rebecca Law
2da6226ace
Add scheduled_tasks to celery_import config
2016-06-20 13:44:24 +01:00
minglis
561b02208d
Merge pull request #451 from alphagov/staging-live-visibility-update
...
Update visibility timeout on staging and live
2016-06-20 13:39:13 +01:00
Rebecca Law
316b5d0e64
Move scheduled tasks into their own module.
...
There is no change to the functionality - only moving the code around.
2016-06-20 13:33:53 +01:00
Martyn Inglis
7d5c25bd48
Update visibility timeout on staging and live
2016-06-20 13:30:57 +01:00
minglis
a786005474
Merge pull request #414 from alphagov/split-sms-and-retry
...
Split sms and retry
2016-06-20 12:23:36 +01:00
Rebecca Law
66c9c5fa16
Merge pull request #445 from alphagov/add-coveralls
...
Add code coverage
2016-06-20 10:21:11 +01:00
Rebecca Law
6ee26bb109
Merge pull request #441 from alphagov/consistent-json-responses
...
Update auth module to return consistently formed error messages.
2016-06-20 10:19:46 +01:00
Chris Hill-Scott
4f145c245a
Add code coverage
2016-06-17 17:09:50 +01:00