Commit Graph

4012 Commits

Author SHA1 Message Date
Rebecca Law
c80bdbaffe Remove email_reply_to and letter_contact_block from Services 2017-11-21 11:06:07 +00:00
Rebecca Law
adaadefed5 Merge pull request #1408 from alphagov/remove-unused-code
Remove unused code
2017-11-21 10:38:41 +00:00
Rebecca Law
e9db7a1561 Need to do the db migration in the next deploy 2017-11-21 10:22:38 +00:00
Sakis
680487eb20 Merge pull request #1405 from alphagov/bump_utils_2301
Bump utils to 23.0.1
2017-11-21 09:09:28 +00:00
Athanasios Voutsadakis
73dfc67400 Merge branch 'master' into bump_utils_2301 2017-11-20 17:40:45 +00:00
Rebecca Law
1bfc22bbb5 Fix merge conflict for db migration 2017-11-20 17:05:46 +00:00
Rebecca Law
785763a172 Merge branch 'master' into remove-unused-code 2017-11-20 16:56:52 +00:00
Alexey Bezhan
cb92ab7107 Merge pull request #1397 from alphagov/validate-template-history-fk-constraint
Validate notifcations.template_history foreign key constraints
2017-11-20 15:33:45 +00:00
Alexey Bezhan
0a50993fc2 Validate notifcations.template_history foreign key constraints
Removes "NOT VALID" mark from the notifications -> template_history
foreign key constraint by validating existing records.

From postgres docs:

> This form validates a foreign key or check constraint that was
> previously created as NOT VALID, by scanning the table to ensure there
> are no rows for which the constraint is not satisfied. Nothing happens
> if the constraint is already marked valid.

> Validation can be a long process on larger tables. The value of
> separating validation from initial creation is that you can defer
> validation to less busy times, or can be used to give additional time
> to correct pre-existing errors while preventing new errors. Note also
> that validation on its own does not prevent normal write commands
> against the table while it runs.

> Validation acquires only a SHARE UPDATE EXCLUSIVE lock on the table
> being altered. If the constraint is a foreign key then a ROW SHARE
> lock is also required on the table referenced by the constraint.
2017-11-20 15:23:27 +00:00
Rebecca Law
d5a1ec0fe3 Remove unused methods 2017-11-20 14:45:11 +00:00
Rebecca Law
c2648d5c9e Remove Services.reply_to_email_address and Services.letter_contact_block 2017-11-20 14:40:24 +00:00
Rebecca Law
33aab4e1b5 Merge branch 'master' into remove-unused-code 2017-11-20 14:34:52 +00:00
Rebecca Law
577463b0ac Remove create_or_update_email_reply_to and create_or_update_letter_contact - no longer needed.
Remove Services.reply_to_email_address and Services.letter_contact_block
2017-11-20 14:33:15 +00:00
Rebecca Law
f4ca658d04 Merge pull request #1407 from alphagov/remove-unused-objects
Remove notification_statistics and Service.sms_sender
2017-11-20 14:26:58 +00:00
Rebecca Law
93f19956b8 Remove notification_statistics and Service.sms_sender 2017-11-20 13:13:13 +00:00
Richard Chapman
f3f8225dfe Merge pull request #1406 from alphagov/rc-monthly-template-usage-endpoint
Template usage stats updates for FY usage and bug fix
2017-11-20 11:45:30 +00:00
Athanasios Voutsadakis
a0beb190f3 Merge branch 'master' into bump_utils_2301 2017-11-20 11:16:29 +00:00
Chris Hill-Scott
42bf329593 Merge pull request #1388 from alphagov/pyup-update-sqlalchemy-utils-0.32.19-to-0.32.21
Update sqlalchemy-utils to 0.32.21
2017-11-20 10:26:22 +00:00
Chris Hill-Scott
3f7aca5f78 Merge pull request #1372 from alphagov/sms-prefix-non-nullable
Make SMS prefix setting non-nullable
2017-11-20 10:15:07 +00:00
Richard Chapman
58b0658a13 Return financial year not calendar and ensure double precision values
are not returned from queries

- Updated stats_template_usage_by_month_dao.py to return the results for
financial year not calendar, as the report os for FY only and hence
only the FY data is required
- Updated services_dao.py to ensure double precision values are converted
to an int as the 'exact' function returns double precision from the
database query, as the admin code requires the value for month to be an
int
2017-11-20 10:01:45 +00:00
Venus Bailey
10f3bc24f0 Merge pull request #1404 from alphagov/vb-test-token
Inbound sms pre-implementation test 1
2017-11-20 09:30:50 +00:00
Athanasios Voutsadakis
b0546f4886 Remove unused variable 2017-11-17 16:22:36 +00:00
Chris Hill-Scott
32e19b6552 Bump utils to 23.0.0
Changes arguments to `SMSMessageTemplate` to better describe what they
do.
2017-11-17 16:20:48 +00:00
venusbb
d70fdbb5c2 no auth check 2017-11-17 15:57:41 +00:00
Athanasios Voutsadakis
69e42b7a74 Bump utils to 23.0.1 2017-11-17 15:00:26 +00:00
Leo Hemsted
354d68de88 Merge pull request #1403 from alphagov/fix-research-mode-email-callbacks
Fix research mode email callbacks
2017-11-17 14:48:37 +00:00
venusbb
12a99f9a7f Verify authorisation header being send 2017-11-17 14:36:28 +00:00
Leo Hemsted
04e3218087 ensure sample SES callbacks and SNS subscription payloads are accurate in research mode and unit tests 2017-11-17 14:34:16 +00:00
Leo Hemsted
d2154451e5 update research mode email callbacks to add process-ses-response task to queue
this involved:
* moving that task to callback_tasks to prevent circular imports
* updating the dummy research mode callbacks (with actual SNS messages from the
  ses simulator emails)
* refactoring tests
2017-11-17 13:41:45 +00:00
Leo Hemsted
0e477b7715 Merge pull request #1401 from alphagov/ses-logging
Ses logging
2017-11-17 10:42:17 +00:00
Sakis
9d2cecd001 Merge pull request #1391 from alphagov/add_proxy_header_check
Add proxy header check
2017-11-17 10:35:43 +00:00
Leo Hemsted
890604990d remove unneccessary ses endpoint tests 2017-11-17 10:31:34 +00:00
Leo Hemsted
5855adf826 removed unused HTTP ses callback handler 2017-11-16 17:53:19 +00:00
Leo Hemsted
1f317b6717 log the bounce message from SES 2017-11-16 17:46:58 +00:00
Leo Hemsted
ff449735e4 make sure fns aren't named the same 2017-11-16 17:46:41 +00:00
Athanasios Voutsadakis
26ba4dad06 Parametrize tests 2017-11-16 17:00:38 +00:00
kentsanggds
6d36a65b65 Merge pull request #1400 from alphagov/ken-allow-include_jobs-arg-get_all_notis
Allow include jobs request param on v2 get all notifications
2017-11-16 16:41:10 +00:00
Athanasios Voutsadakis
0886f6d9f9 Merge branch 'master' into add_proxy_header_check 2017-11-16 16:36:02 +00:00
Ken Tsang
64c0ae6492 Update test to show gets all notifications except job notis 2017-11-16 16:02:31 +00:00
Richard Chapman
2ee91cd629 Merge pull request #1399 from alphagov/rc-monthly-template-usage-endpoint
Added a template_type to the rest call and Aggregation Bug Fix
2017-11-16 15:55:55 +00:00
Rebecca Law
35f1704a9d Merge pull request #1395 from alphagov/catch-inbound-sms-push-exception
Retry unknown exceptions for send_inbound_sms_to_service task
2017-11-16 15:47:14 +00:00
Richard Chapman
b56825a680 Updated Tests to use a variety of templates
All of the tests defaulted to sms templates, updated a few to use a
variety of templates types so all types are tested.
2017-11-16 15:43:21 +00:00
Richard Chapman
fd89a252e0 Code Style Updates
Updated the to conform with the line ends expected by the code style in
tests rather than PyCharm.
2017-11-16 15:17:27 +00:00
Richard Chapman
e7de0c0900 Added a template_type to the rest call
Added a template type which is required for the admin UI and updated the
tests. The rest tests needed updated because of the bug fix for
aggregation.
2017-11-16 15:17:27 +00:00
Richard Chapman
5ba58031b1 Fixed Bug in stats aggregation
The check for aggregation was too broad and hence was adding together
totals based on template_id and not the unqiue combination of
template id, month and year.

- Added test to test for the failure
- Added check and a test to for template_id, mon and year matches
- Celery process name did not match the task
2017-11-16 15:17:27 +00:00
Ken Tsang
0e473cace5 Update rest endpoint to handle include_jobs arg 2017-11-16 14:45:02 +00:00
Ken Tsang
df98f0dec1 Update schema to allow include_jobs on get_notis 2017-11-16 14:44:28 +00:00
Chris Hill-Scott
492462d4f9 Make getting a service return prefix_sms column
This gives us the confidence to remove references to the computed
column in https://github.com/alphagov/notifications-admin/pull/1619
2017-11-16 14:29:32 +00:00
Chris Hill-Scott
4eaa482b2d Rewrite existing test to use admin_request fixture
Makes it consistent with the other, related, test in this PR.
2017-11-16 14:29:32 +00:00
Chris Hill-Scott
e8a94422e5 Make SMS prefix setting non-nullable
We have now:
- defaulted new services to start with this column set to `true`
- migrated all preexisting services[1] to have either `true` or `false` set
  for this column

There is no way for a service to switch back from `true`/`false` to
`null`.

This means that we can safely enforce a non-nullable constraint on this
column now.

1. There is a little gotcha: the GOV.UK Notify service still relies on
   the `sms_sender` column. It doesn’t have a row in the
   `service_sms_senders` table. This means the previous migration
   never changed this service’s value for `prefix_sms` from `null`. So
   this commit also changes its value to `False`, so that the rest of
   the migration, of the whole column, is possible.
2017-11-16 14:29:32 +00:00