From 615658b18e21ae06cf09314cabb37422b90e8ff9 Mon Sep 17 00:00:00 2001 From: Mubbshar Anwar <78487564+mubbsharanwar@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:13:48 +0500 Subject: [PATCH] fix: update key name for save/program api (#29798) update key name from uuid to program_uuid for save/program/ api. --- lms/djangoapps/save_for_later/api/v1/tests/test_views.py | 6 +++--- lms/djangoapps/save_for_later/api/v1/views.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/save_for_later/api/v1/tests/test_views.py b/lms/djangoapps/save_for_later/api/v1/tests/test_views.py index 7887f655c3..bf93c23dc5 100644 --- a/lms/djangoapps/save_for_later/api/v1/tests/test_views.py +++ b/lms/djangoapps/save_for_later/api/v1/tests/test_views.py @@ -125,7 +125,7 @@ class ProgramSaveForLaterApiViewTest(ThirdPartyAuthTestMixin, APITestCase): mock_get_programs.return_value = self.program request_payload = { 'email': self.email, - 'uuid': self.uuid, + 'program_uuid': self.uuid, } response = self.client.post(self.api_url, data=request_payload) assert response.status_code == 200 @@ -144,7 +144,7 @@ class ProgramSaveForLaterApiViewTest(ThirdPartyAuthTestMixin, APITestCase): """ request_payload = { 'email': self.email, - 'uuid': self.uuid, + 'program_uuid': self.uuid, } for _ in range(int(settings.SAVE_FOR_LATER_EMAIL_RATE_LIMIT.split('/')[0])): response = self.client.post(self.api_url, data=request_payload) @@ -167,6 +167,6 @@ class ProgramSaveForLaterApiViewTest(ThirdPartyAuthTestMixin, APITestCase): """ Test email validation """ - request_payload = {'email': self.invalid_email, 'uuid': self.uuid} + request_payload = {'email': self.invalid_email, 'program_uuid': self.uuid} response = self.client.post(self.api_url, data=request_payload) assert response.status_code == 400 diff --git a/lms/djangoapps/save_for_later/api/v1/views.py b/lms/djangoapps/save_for_later/api/v1/views.py index ee66f34c07..970ab1a487 100644 --- a/lms/djangoapps/save_for_later/api/v1/views.py +++ b/lms/djangoapps/save_for_later/api/v1/views.py @@ -118,7 +118,7 @@ class ProgramSaveForLaterApiView(APIView): """ user = request.user data = request.data - program_uuid = data.get('uuid') + program_uuid = data.get('program_uuid') email = data.get('email') if getattr(request, 'limited', False):