Commit Graph

3594 Commits

Author SHA1 Message Date
pyup-bot
0f4a3ce8a6 Update pytest from 3.2.2 to 3.2.3 2017-10-04 22:18:02 +01:00
Rebecca Law
519c98615b Merge pull request #1288 from alphagov/return-service_sms_sender_value
Return service_sms_sender
2017-10-04 15:29:24 +01:00
Rebecca Law
9d507466ef Remove exception thrown when getting default sender.
Having more than one default is checked on insert and update.
2017-10-04 14:51:02 +01:00
Richard Chapman
2fbe492d5c [2/10] Allow API calls to specify the reply address option (#1291)
* Added service_email_reply_to_id to the POST /v2/notifications/email and a test to test the validator

* Caught NoResultFound exception in check_service_email_reply_to_id as it was not being caught when there there was no valid service_id or reply_to_id. Fixed failing tests which were not passing due to the NoResultFound exception and added further tests to check for the good path through the code and an test to check for an invalid service_id

* Added service_email_reply_to_id to the POST /v2/notifications/email and a test to test the validator

* Caught NoResultFound exception in check_service_email_reply_to_id as it was not being caught when there there was no valid service_id or reply_to_id. Fixed failing tests which were not passing due to the NoResultFound exception and added further tests to check for the good path through the code and an test to check for an invalid service_id

* Fixed code style in validators.py to confirm with rules
Update the name of email_reply_to_id to conform better with other attributes in the schema and the resultant code in post_notifications.py
Fixed code style in test_validators.py to confirm with rules
Added tests to test_post_notifications.py to test the email_reply_to_id being present and being incorrect, it being optional is being tested by other tests.

* Added service_email_reply_to_id to the POST /v2/notifications/email and a test to test the validator

* Added service_email_reply_to_id to the POST /v2/notifications/email and a test to test the validator

* Caught NoResultFound exception in check_service_email_reply_to_id as it was not being caught when there there was no valid service_id or reply_to_id. Fixed failing tests which were not passing due to the NoResultFound exception and added further tests to check for the good path through the code and an test to check for an invalid service_id

* Caught NoResultFound exception in check_service_email_reply_to_id as it was not being caught when there there was no valid service_id or reply_to_id. Fixed failing tests which were not passing due to the NoResultFound exception and added further tests to check for the good path through the code and an test to check for an invalid service_id

* Fixed code style in validators.py to confirm with rules
Update the name of email_reply_to_id to conform better with other attributes in the schema and the resultant code in post_notifications.py
Fixed code style in test_validators.py to confirm with rules
Added tests to test_post_notifications.py to test the email_reply_to_id being present and being incorrect, it being optional is being tested by other tests.

* Minor update after manual merge to fix check style rule break in test_validators.py where a single space was introduced.

* Updates after code review. Moved the template from the exception message as it was not required and updated the error message to match the field name in the sschema for better debugging and error identification.

* Fixed test after update of exception message
2017-10-04 14:34:45 +01:00
Rebecca Law
cefb74c732 Removed a test that should have been removed during the last merge 2017-10-04 13:49:01 +01:00
Rebecca Law
78a9d74c49 Merge branch 'master' into return-service_sms_sender_value 2017-10-04 13:29:05 +01:00
Sakis
517fec5e36 Merge pull request #1293 from alphagov/fix-cffi
Pin to a specific version of cffi
2017-10-04 12:34:39 +01:00
Athanasios Voutsadakis
80c2d85508 Instruct pyup to skip cffi==1.11.1 2017-10-04 12:20:21 +01:00
Athanasios Voutsadakis
c362bd06b0 Pin to a specific version of cffi
Version 1.11.1 seems to be
[broken](https://bitbucket.org/cffi/cffi/issues?status=new&status=open)

It's pulled in because of [Flask-bcrypt](https://github.com/alphagov/notifications-api/blob/master/requirements.txt#L4)
which [depends on bcrypt](https://github.com/maxcountryman/flask-bcrypt/blob/master/setup.py#L33) which
[asks for a version of cffi >= 1.1](https://github.com/pyca/bcrypt/blob/master/setup.py#L12)
2017-10-04 10:58:22 +01:00
Sakis
3ad0a43409 Merge pull request #1283 from alphagov/ensure-db-creds-rotation
Unbind the db service before pushing the app
2017-10-04 09:41:16 +01:00
Katie Smith
0903a28ba8 Merge pull request #1281 from alphagov/imdad-katie-return-letter-contact-from-new-table
[4/4] Use letter contact from the new table
2017-10-03 16:42:40 +01:00
Katie Smith
dede336b3b Update tests to not use letter contact block from services table
A few test updates were needed after rebasing onto master.
2017-10-03 13:35:09 +01:00
Rebecca Law
73db7650b7 Merge pull request #1290 from alphagov/update-runtime-python-version
Update runtime Python version to 3.5.4
2017-10-03 12:19:35 +01:00
Richard Chapman
e4b95ab20a Merge pull request #1282 from alphagov/rc_notifications_email_sender
[1/10] Allow API calls to specify the reply address option
2017-10-03 11:56:26 +01:00
Katie Smith
244bacc763 Update runtime Python version to 3.5.4
See 40995d807b
2017-10-03 11:27:07 +01:00
Rebecca Law
d1d655e23d Kept the test after all 2017-10-03 11:04:29 +01:00
Richard Chapman
d8e1a34610 Added a unique constraint to the notification_id column of the notification_to_email_reply_to table so that each notification can only have one mapping to service_email_reply_to and hence one email address. 2017-10-03 11:03:31 +01:00
Imdad Ahad
cb37ba5f78 Update schema to return default letter contact for a service 2017-10-03 10:31:21 +01:00
Imdad Ahad
4eebd9a83c Remove the letter_contact_block from the Service model 2017-10-03 10:31:21 +01:00
Imdad Ahad
d21d9cabd1 Use new default letter contact in the DVLA celery task 2017-10-03 10:31:15 +01:00
Rebecca Law
eff2a720ea Update post_allocate_inbound_number to set the service_sms_sender in the case when a service had the number, then it was set to inactive and now there is a request to turn it back on (or click allow inbound sms a couple of times on the front end) 2017-10-02 17:35:58 +01:00
Rebecca Law
fb68767720 Update service_schema to return the default sms_sender from the new table rather than the services table. 2017-10-02 17:15:15 +01:00
Venus Bailey
84d7e93b9b Merge pull request #1289 from alphagov/vb-platform-admin-api
admin to api not passing trial_mode_service
2017-10-02 16:39:07 +01:00
Athanasios Voutsadakis
2c590acff5 Also unbind notify-config and notify-aws 2017-10-02 16:25:49 +01:00
Rebecca Law
0db39bfac8 Fix the unit tests.
I think there was some imports missed when resolving merge conflicts.
Also I'm not sure why the test_update_letter_notification_to_sent or error passed, I've updated them so they do pass.
2017-10-02 15:29:13 +01:00
Katie Smith
9d26e28c82 Merge pull request #1278 from alphagov/imdad-katie-migrate-data-letter-contact
[3/4] - Populate service_letter_contacts from existing data
2017-10-02 15:07:31 +01:00
Rebecca Law
d5c9174641 Merge branch 'master' of github.com:alphagov/notifications-api into return-service_sms_sender_value 2017-10-02 12:36:46 +01:00
venusbb
9a5addb896 Reverse codes that uses filtering of trial mode services 2017-10-02 12:00:52 +01:00
Imdad Ahad
1dd3298290 Add command to populate new service letter contact table from existing data 2017-10-02 11:46:19 +01:00
Chris Hill-Scott
2614d719d1 Merge pull request #1264 from alphagov/template-returns-placeholders
Return placeholders when getting a template
2017-10-02 11:21:46 +01:00
Rebecca Law
ba7cd79581 Created a get_default_sms_sender method, which returns the default sms_sender from the service_sms_sender table rather than service.sms_sender.
One step closer to removing services.sms_sender.

fix the unit tests
2017-10-02 10:29:00 +01:00
Katie Smith
f90a10ab38 Merge pull request #1277 from alphagov/imdad-katie-store-multiple-letter-contacts
[2/4] Upsert into ServiceLetterContact table when updating a service
2017-10-02 10:23:20 +01:00
Richard Chapman
fdc4d4c24f Reanmed the link table to be a bteer description of what the table is for as it was previously confusing. Updated the migration script to reflect those changes 2017-09-28 11:11:41 +01:00
Leo Hemsted
a74db5a80b Merge pull request #1280 from alphagov/letter-api-not-by-job
Letter api not by job
2017-09-28 10:55:58 +01:00
Venus Bailey
e2bf6fde67 Merge pull request #1284 from alphagov/vb-inbound-sms-ip
Inbound sms ip messages
2017-09-28 10:20:31 +01:00
venusbb
eb840585a7 Inbound sms ip messages 2017-09-28 10:17:59 +01:00
Athanasios Voutsadakis
912728713a Unbind the db service before pushing the app
This should cause the app to get new credentials for the database upon
pushing.
2017-09-27 12:11:44 +01:00
Venus Bailey
9a1aedec43 Merge pull request #1279 from alphagov/vb-inbound-sms-ip
Enable Inbound sms IP blocking
2017-09-27 12:07:24 +01:00
Richard Chapman
6356a5320a Updated model with a new table notification_to_email_sender and created db migration script 2017-09-27 10:36:25 +01:00
venusbb
9ad75ff726 Tests modified 2017-09-27 10:15:29 +01:00
venusbb
8f76338c7b Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-inbound-sms-ip 2017-09-27 10:00:42 +01:00
Rebecca Law
af48e336b5 Merge pull request #1276 from alphagov/migrate_service_sms_senders
Migration for Service SMS senders
2017-09-27 09:46:31 +01:00
Leo Hemsted
c97b130540 test dvla callback update tasks 2017-09-26 12:36:42 +01:00
Leo Hemsted
18ed90158e add tests for new noti dao function 2017-09-26 12:16:33 +01:00
Leo Hemsted
aaadf09562 add tests for new sched task 2017-09-26 12:03:06 +01:00
Leo Hemsted
b1928b928c update process_letter tests 2017-09-26 11:28:54 +01:00
venusbb
6a7013fa7a Enable Inbound sms IP blocking 2017-09-26 10:59:09 +01:00
Leo Hemsted
f3db920c71 remove jobs from letter api calls
we now no longer create a job. At the end of the post there is no
action, as we don't have any tasks to queue immediately - if it's a
real notification it'll get picked up in the evening scheduled task.

If it's a test notification, we create it with an initial status of
sending so that we can be sure it'll never get picked up - and then we
trigger the update-letter-notifications-to-sent-to-dvla task to sent
the sent-at/by.
2017-09-26 09:57:36 +01:00
Leo Hemsted
daf1dc4dca fix bucket names and change crontab param order for clarity 2017-09-26 09:57:36 +01:00
Leo Hemsted
5e230943c4 remove trailing comma from CELERY_ENABLE_UTC, a beat config option
To run beat after this, you must remove the celerybeat-schedule file from your notifications-api
project root
2017-09-26 09:57:36 +01:00