From cffd66c62ecc8f6ee27baae12cd33d2243d638ac Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Fri, 19 Feb 2016 16:08:44 +0000 Subject: [PATCH] Updated the api_client call to send_verify_code The api has now has an user//email-code and user//sms-code This commit requires an update to the python-client. Make sure the PR for that version has been merged first and the tag push using scripts/push_tag.sh --- app/notify_client/user_api_client.py | 6 ++---- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index 81e6a3853..34f936529 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -65,10 +65,8 @@ class UserApiClient(BaseAPIClient): return None def send_verify_code(self, user_id, code_type, to=None): - data = {'code_type': code_type} - if to: - data['to'] = to - endpoint = '/user/{}/code'.format(user_id) + data = {'to': to} if to else {} + endpoint = '/user/{0}/{1}-code'.format(user_id, code_type) resp = self.post(endpoint, data=data) def check_verify_code(self, user_id, code, code_type): diff --git a/requirements.txt b/requirements.txt index 631ea6965..49dceaccf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,6 @@ credstash==1.8.0 boto3==1.2.3 Pygments==2.0.2 -git+https://github.com/alphagov/notifications-python-client.git@0.2.5#egg=notifications-python-client==0.2.5 +git+https://github.com/alphagov/notifications-python-client.git@0.2.5#egg=notifications-python-client==0.2.7 git+https://github.com/alphagov/notifications-utils.git@0.1.0#egg=notifications-utils==0.1.0