Commit Graph
535 Commits
Author SHA1 Message Date
Leo Hemsted 350133e6db ensure created_by_id is being persisted correctly
(also make sure it's well tested 🎉 )
2017-06-23 15:56:47 +01:00
Rebecca Law e0d23f40f6 Merge pull request #1038 from alphagov/push-inbound-sms
Push inbound sms
2017-06-21 15:49:32 +01:00
Rebecca Law c608f5997b New task to send the inbound sms to the service.
If the service has not set the url then nothing happens.
If the request to the service url returns with 500 or greater the task is retries.
The task is created when the SMS provider post the inbound SMS.
2017-06-20 17:13:40 +01:00
Leo Hemsted ac7665bfc6 celery test cleanup
* Alter config so an error will be raised if you forget to mock out a
  celery call in one of your tests
* Remove an unneeded exception type that was masking errors
2017-06-20 12:06:49 +01:00
Leo Hemsted a1e570dea7 persist created_by_id when using the one off notification endpoint 2017-06-20 12:06:49 +01:00
Rebecca Law 3a66027d6a Refactor ApiKeys.secret and ServiceInboundApi.bearer_token to use the same encryption method and get rid of the duplicate code. 2017-06-19 14:32:22 +01:00
Martyn Inglis 29455b6d3b Strip leading 44 from inbound SMS numbers to normalise to how we store things. 2017-06-06 11:50:30 +01:00
Martyn Inglis b296e736f2 Reorder the migrations. 2017-06-05 11:51:30 +01:00
Martyn Inglis f15d235d1e Merge branch 'master' into firetext-inbound-sms 2017-06-05 11:33:53 +01:00
Martyn Inglis 012f8d2675 Adds provider onto the inbound sms table so we know where this came from. 2017-06-02 16:37:57 +01:00
Martyn Inglis 3e1de2e901 Capture the fire text callbacks.
Parse the form data, and stop the message
2017-06-02 15:58:36 +01:00
Leo Hemsted bf18b179b0 ensure the user_number in inbound sms is international
rather than using the `normalise_phone_number` function, use the
`validate_and_format_phone_number` function - this will also convert
all numbers to international format, which means we won't need to
worry about whether the user enters internaional or UK phone numbers
when searching
2017-06-02 15:20:18 +01:00
Leo Hemsted d9bdacb5cd parse datetimes from mmg inbound sms
the DateRecieved field from MMG comes in with +s instead of spaces,
and uriencoded (the same as how they format their messages)
Make sure we decode this, and then convert to a UTC timestamp
2017-06-02 10:14:01 +01:00
Leo Hemsted dba4e2ad89 mmg spell received incorrectly, lets use that 2017-06-01 17:27:09 +01:00
Martyn Inglis c57e2a6894 Merge branch 'master' into inbound-sms
Conflicts:
	app/notifications/receive_notifications.py
	tests/app/notifications/test_receive_notification.py
2017-06-01 15:56:33 +01:00
Leo Hemsted dd9fd6cf92 still return RECEIVED even if we couldn't find a matching service
mmg don't need to retry that message or anything. just log it.
2017-06-01 13:13:51 +01:00
Martyn Inglis a7fd624db5 Added simple logging endpoint for fire text inbound SMS calls
- logs post data
- OK to log all as not currently in use so no real user data expected.
2017-06-01 08:21:18 +01:00
Martyn Inglis 3c416d3631 Simple end point for fire text inbound SMS callbacks. 2017-05-31 16:15:25 +01:00
Leo Hemsted ef799d0515 add sad path tests for inbound sms 2017-05-30 11:14:18 +01:00
Leo Hemsted 4a85818c34 add inbound sms table 2017-05-30 10:47:01 +01:00
Martyn Inglis 75c5e5e5d5 Merge branch 'master' into redo-queue-visibitlity-timeout
Conflicts:
	app/notifications/process_notifications.py
	app/v2/notifications/post_notifications.py
2017-05-30 10:18:18 +01:00
Imdad Ahad 6c4377bd44 Persist normalised email 2017-05-26 10:26:07 +01:00
Imdad Ahad cbc92a6173 Store the normalised number on the notification 2017-05-26 10:26:07 +01:00
Martyn Inglis 2591d3a1df This massive set of changes uses the new queue names object throughout the app and tests.
Lots of changes, all changing the line of code that puts things into queues, and the code that tests that.
2017-05-25 10:51:49 +01:00
Rebecca Law 751abb4b99 Update dateformat for scheduled_for to include minutes. 2017-05-22 14:15:35 +01:00
Rebecca Law 3a3161ecc4 Merge branch 'master' into schedule-api-notification
Conflicts:
	app/celery/scheduled_tasks.py
	app/v2/notifications/post_notifications.py
	tests/app/celery/test_scheduled_tasks.py
2017-05-22 14:05:57 +01:00
Imdad Ahad 0e0c18583f Fix test data and how we parse the JSON 2017-05-19 10:16:48 +01:00
Martyn Inglis 8dc7a86148 Merge branch 'master' into async-job-stats
Conflicts:
	app/dao/services_dao.py
2017-05-18 09:34:54 +01:00
Rebecca Law 973cc2c4c9 Changed the scheduled_for datetime to only send and hour of a day to send.
Also expect the date being passed in is BST. The date is converted to UTC before saving. And converted to BST when returning a notification.
2017-05-17 15:06:15 +01:00
minglis 05a179c6ef Merge pull request #941 from alphagov/load-service-on-auth
Load service on auth
2017-05-17 10:49:00 +01:00
Martyn Inglis 83a1b1526e Merge branch 'master' into async-job-stats
Conflicts:
	app/notifications/notifications_ses_callback.py
2017-05-17 09:49:43 +01:00
Imdad Ahad e6db9ffc1b Force parse JSON received from SNS:
* An SNS callback containing JSON has a plaintext header set. Using
* request.get_json() will return None if the header is not
* application/json unless the force parameter is set to True
2017-05-16 10:29:27 +01:00
Imdad Ahad 4003edfa67 Add DVLA callback:
* Process SNS callback, trigger the update notifications celery task
* Put autoconfirm into its own method and use in callbacks
2017-05-15 11:12:31 +01:00
Imdad Ahad 7a10a91262 Revert "Process SNS request triggered by a DVLA S3 update" 2017-05-12 17:21:07 +01:00
Martyn Inglis f4020aec05 these three tests replicate some testing that is done in the client tests themselves. 2017-05-12 16:10:21 +01:00
Imdad Ahad 37165e5b6a Add autoconfirm sns in dvla callback 2017-05-12 14:24:27 +01:00
Imdad Ahad 8a5e82904e Update to pull from correct bucket and fix tests not mocking out correctly 2017-05-12 14:24:26 +01:00
Imdad Ahad 20bb91bfdd Update DVLA callback to process request and call task (if it can) 2017-05-12 14:24:26 +01:00
Martyn Inglis 19c14982a2 Call the task wrapper outcome function in the statistics_tasks file. This wraps the logic around which tasks to creates and simplifies the logic in the Callback classes. 2017-05-09 22:03:57 +01:00
Martyn Inglis caed193647 Use the new task wrapper methods rather than creating a task directly 2017-05-09 18:17:55 +01:00
Sakis 01e3a88d55 Merge pull request #920 from alphagov/autoconfirm_http_subscriptions
Autoconfirm http subscriptions
2017-05-02 17:03:41 +01:00
Martyn Inglis a9539d892c Merge branch 'master' into rate-limit-api-calls
Conflicts:
	requirements.txt
	tests/app/notifications/rest/test_send_notification.py
	tests/app/notifications/test_validators.py
	tests/app/v2/notifications/test_post_notifications.py
2017-05-02 10:56:56 +01:00
Athanasios Voutsadakis c99b65252f Fix some typos 2017-04-28 16:11:27 +01:00
Athanasios Voutsadakis 336462cdb2 Fix whitespaces 2017-04-28 15:11:36 +01:00
Athanasios Voutsadakis 74433c9335 Add tests for autoconfirmation 2017-04-28 15:11:36 +01:00
Imdad Ahad 252c3235d7 Persist intl fields on notification 2017-04-27 13:24:36 +01:00
minglis a8ea333606 Merge pull request #923 from alphagov/validate-int-numbers-on-api
Validate International phone numbers
2017-04-27 13:21:04 +01:00
Martyn Inglis 83dc7c2bb7 Little test updates 2017-04-27 09:58:37 +01:00
Imdad Ahad 05145afcec Fix tests for checking simulated recipients 2017-04-26 17:26:06 +01:00
Martyn Inglis 2a0f8c8808 Validate International phone numbers
- uses new utils methods to validate phone numbers
- defaults to International=True on validation. This ensures the validator works on all numbers
- Then check if the user can send this message to the number internationally if needed.
2017-04-26 15:56:45 +01:00