Rebecca Law
fb04b36cba
Fix **kwargs
2016-04-07 10:53:59 +01:00
Rebecca Law
b4473a2825
Merge branch 'master' into integrate_MMG
2016-04-07 10:44:13 +01:00
Rebecca Law
c132bbf46e
Rename NOTIFY_FROM_NUMBER to MMG_FROM_NUMBER, there should be a separate short code per provider.
2016-04-07 10:18:46 +01:00
Adam Shimali
66e0f225a9
Merge pull request #205 from alphagov/fix-for-stats-window
...
Fix for date range required for template stats
2016-04-07 10:01:33 +01:00
Adam Shimali
4ed2e7f8f2
Fix for misunderstanding about date range required for templates
...
stats.
It should always be last n days, whether or not there is data.
2016-04-07 09:30:02 +01:00
Rebecca Law
340f8ceaf6
Update mmg send_sms to include cid and request headers
...
Use mmg to send_sms
2016-04-06 17:35:14 +01:00
Rebecca Law
90194cbbb8
Remove the abstract ClientResponses class. Refactor aws_ses not to require the class.
...
All three client now use a response_map for the delivery receipt processing.
2016-04-06 16:34:45 +01:00
Rebecca Law
323b2ff537
Use MMG client for send-sms
2016-04-06 15:56:34 +01:00
Adam Shimali
3912cd95aa
Merge pull request #204 from alphagov/add-timestamp-to-template-stats
...
Change sort order for templates
2016-04-06 15:10:59 +01:00
Rebecca Law
e8d5a9292a
Merge branch 'master' into integrate_MMG
...
Conflicts:
app/notifications/rest.py
2016-04-06 14:58:13 +01:00
Rebecca Law
4806123d5c
Add process_mmg_responses
...
Refactor process_firetext_responses
Removed the abstract ClientResponses for firetext and mmg. There is a map for each response to handle the status codes sent by each client.
Since MMG has about 20 different status code, none of which seem to be a pending state (unlike firetext that has 3 status one for pending - network delay).
For MMG status codes, look for 00 as successful, everything else is assumed to be a failure.
2016-04-06 14:31:33 +01:00
Adam Shimali
3057641e40
Change sort order for templates from name to date using full timestamp
...
so that it would be most recently used at top.
2016-04-06 14:30:13 +01:00
Chris Hill-Scott
044f2b7896
Merge pull request #203 from alphagov/double-check-restricted-mode
...
Catch sending to restricted recipients in Celery
2016-04-06 13:10:45 +01:00
Chris Hill-Scott
a63d6aa168
Add test for sending email while service restricted
2016-04-05 15:27:16 +01:00
Chris Hill-Scott
eef6d80ae2
Catch sending to restricted recipients in Celery
...
The Celery `send_sms` and `send_email` tasks _could_ assume that all the
recipients it gets are safe, because they have been checked either:
- when the admin app processes the CSV
- in the `/notifications/sms|email` endpoint
*However*, it’s probably safer to make the check again when the Celery
task run and passes the message off to the third party.
This also means that changing a service _back_ to restricted would have
an effect on messages that were queued, as well as all subsequent
messages.
This commit:
- restores the test that was removed here:
e56aee5d1d (diff-e5627619e387fccc04783c32a23e6859L346)
- adds checks back into the Celery tasks for sending email and SMS,
using the `allowed_to_send_to` function that was introduced into utils
in https://github.com/alphagov/notifications-utils/pull/16
2016-04-05 15:11:27 +01:00
NIcholas Staples
2e09ead30f
Merge pull request #198 from alphagov/retain_all_notifications_for_7_days
...
Successful notifications are deleted after a week now. All tests pass…
2016-04-05 15:05:58 +01:00
NIcholas Staples
0ebfe8f699
Merge pull request #201 from alphagov/remove_csv_after_processing
...
Remove csv after process job is finished.
2016-04-05 15:05:24 +01:00
Nicholas Staples
4cc0028b01
Remove csv after process job is finished.
...
Fixed new tests.
2016-04-05 14:55:03 +01:00
Rebecca Law
f2ee8f3eb7
WIP
2016-04-05 14:39:59 +01:00
Chris Hill-Scott
cb5151d9be
Merge pull request #199 from alphagov/whitelist-bug-fix
...
Fix bug with whitelist
2016-04-05 12:08:56 +01:00
Chris Hill-Scott
7f7c5bc9d3
Fix bug with whitelist
...
Implements https://github.com/alphagov/notifications-utils/pull/17
2016-04-05 12:00:31 +01:00
Nicholas Staples
4d15409781
Successful notifications are deleted after a week now. All tests passing.
2016-04-05 11:07:21 +01:00
Chris Hill-Scott
e465dc8bc4
Merge pull request #195 from alphagov/use-utils-validate-restricted
...
Validate recipient for restricted service using utils
2016-04-05 10:20:27 +01:00
Adam Shimali
f4b69a37d4
Merge pull request #196 from alphagov/template-stats-order
...
Additional sort order by template name for template statistics.
2016-04-05 09:56:37 +01:00
Chris Hill-Scott
e56aee5d1d
Validate recipient for restricted service w/ utils
...
Implements
https://github.com/alphagov/notifications-utils/pull/16
Once
https://github.com/alphagov/notifications-admin/pull/376
is merged it will no longer be possible for a user to upload a CSV file
containing recipients that they’re not allowed to send to.
So this commit also removes any restricted service checks in the task,
because any public phone numbers/email addresses no longer have any way
of reach this point if the service is restricted.
2016-04-04 20:10:19 +01:00
Rebecca Law
3820090a19
WIP: building the mmg delivery receipt endpoint.
2016-04-04 18:08:37 +01:00
Adam Shimali
f6620792b5
Additional sort order by template name for template statistics.
2016-04-04 17:51:24 +01:00
Rebecca Law
2ba12da77d
WIP: adding delivery receipt endpoint for mmg
2016-04-04 15:02:21 +01:00
Adam Shimali
30f0ca3e43
Merge pull request #191 from alphagov/wip-read-template-statistics
...
[WIP] Added dao method and rest endpoint
2016-04-04 15:00:14 +01:00
Adam Shimali
e4a5e3890a
Corrected error message format
2016-04-04 14:51:56 +01:00
Adam Shimali
0d06be05e1
[WIP] Added dao method and rest endpoint for getting template
...
statistics by service.
Some cosmetic changes to imports.
Added fix for job rest not correctly returning errors.
2016-04-04 14:38:54 +01:00
NIcholas Staples
e2d0d39ea7
Merge pull request #192 from alphagov/update_filter_for_multiple_arguments
...
Added functionality to allow filtering by multiple arguments.
2016-04-04 14:29:53 +01:00
Nicholas Staples
fac34aff10
Added functionality to allow filtering by multiple arguments.
...
Removed commented out code.
2016-04-04 13:21:51 +01:00
Rebecca Law
69697388d7
Initial set up for mmg client integration
2016-04-01 16:42:31 +01:00
Rebecca Law
9946427eb6
Merge pull request #189 from alphagov/remove_email_safe
...
Remove email_safe function
2016-04-01 14:48:18 +01:00
Rebecca Law
df6f784f9e
- Remove different behaviour for debug mode in errors.py
2016-04-01 14:19:50 +01:00
Rebecca Law
ec180980ee
Merge branch 'master' into remove_email_safe
2016-04-01 13:45:21 +01:00
Rebecca Law
8493e29acc
Added some more tests.
...
Removed the validation in the schema - it was adding complexity, let the unique constraint on the db throw the exception. This should only ever happen on a race condition which seems unlikely (two people changing a service to the same name at the same time)
Do no set debug=true to the test config. If debug=true it changes the behaviour of the error handlers, throwing the exception rather than returning a 500.
2016-04-01 13:42:11 +01:00
NIcholas Staples
42b9f13308
Merge pull request #190 from alphagov/no_limit_for_active_service
...
No limit for live services.
2016-04-01 11:18:23 +01:00
Nicholas Staples
514d490d2f
No limit for live services.
2016-04-01 11:12:44 +01:00
Adam Shimali
1f92255352
Merge pull request #188 from alphagov/wip-template-stats
...
[WIP] On create of notification. Upsert record for template stats
2016-04-01 10:00:33 +01:00
Rebecca Law
8df4919029
The admin app now sends the email from when creating a service and when updating the service name.
...
This PR removes the need for the email_safe function. The api does not create the email_from field for the service.
Tests were updated to reflect this change.
2016-03-31 17:46:18 +01:00
Adam Shimali
0d0cfbb6ac
Better test for failed update of stats
2016-03-31 17:20:57 +01:00
Adam Shimali
efc382f18b
Added test to verify a number of notications followed by a failure does
...
not increment stats counts.
2016-03-31 16:53:47 +01:00
Adam Shimali
ca9c886c3e
[WIP] On create of notification. Upsert record for template stats
...
recording usages of template by day.
2016-03-31 15:57:50 +01:00
Rebecca Law
7ec1f31bab
Fix sql, db user on preview does not have access to delete from pg_enum
2016-03-30 12:30:17 +01:00
Rebecca Law
0e8ed0933b
Merge pull request #186 from alphagov/add-view-activity-permission
...
Add view activity permission
2016-03-30 11:35:13 +01:00
Rebecca Law
4f9dd4863f
Merge branch 'master' into add-view-activity-permission
2016-03-30 09:34:36 +01:00
Rebecca Law
c7c845cea6
Remove access_developer_docs as a permission type. It does not make sense to have permission for viewing the documentation.
...
On the downgrade method of the db script the assumption that all users with manage_api_keys had the access_developer_docs permission.
2016-03-29 17:00:42 +01:00
Rebecca Law
376a074f5f
Add view_activity permission so that users can have the default permission to see activity.
...
Add view_activity to default permissions when adding a new user.
Add view_activity as a permission group, used when inviting a user.
2016-03-29 15:35:34 +01:00