diff --git a/openedx/core/djangoapps/user_authn/views/register.py b/openedx/core/djangoapps/user_authn/views/register.py index 44023de5c4..a5fc1191a5 100644 --- a/openedx/core/djangoapps/user_authn/views/register.py +++ b/openedx/core/djangoapps/user_authn/views/register.py @@ -509,5 +509,7 @@ class RegistrationView(APIView): return response, user def _create_response(self, response_dict, status_code): - response_dict['success'] = (status_code == 200) + if status_code == 200: + # keeping this `success` field in for now, as we have outstanding clients expecting this + response_dict['success'] = True return JsonResponse(response_dict, status=status_code) diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_register.py b/openedx/core/djangoapps/user_authn/views/tests/test_register.py index c047793dca..cbd9607397 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_register.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_register.py @@ -109,7 +109,6 @@ class RegistrationViewValidationErrorTest(ThirdPartyAuthTestMixin, UserAPITestCa self.assertDictEqual( response_json, { - "success": False, "email": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -152,7 +151,6 @@ class RegistrationViewValidationErrorTest(ThirdPartyAuthTestMixin, UserAPITestCa self.assertDictEqual( response_json, { - "success": False, "email": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -195,7 +193,6 @@ class RegistrationViewValidationErrorTest(ThirdPartyAuthTestMixin, UserAPITestCa self.assertDictEqual( response_json, { - "success": False, "username": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -233,7 +230,6 @@ class RegistrationViewValidationErrorTest(ThirdPartyAuthTestMixin, UserAPITestCa self.assertDictEqual( response_json, { - "success": False, "email": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -271,7 +267,6 @@ class RegistrationViewValidationErrorTest(ThirdPartyAuthTestMixin, UserAPITestCa self.assertDictEqual( response_json, { - u"success": False, u"username": [{ u"user_message": ( u"An account with the Public Username '{}' already exists." @@ -308,7 +303,6 @@ class RegistrationViewValidationErrorTest(ThirdPartyAuthTestMixin, UserAPITestCa self.assertDictEqual( response_json, { - "success": False, "email": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -1480,7 +1474,6 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase): self.assertDictEqual( response_json, { - "success": False, "email": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -1516,7 +1509,6 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase): self.assertDictEqual( response_json, { - "success": False, "username": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -1552,7 +1544,6 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase): self.assertDictEqual( response_json, { - "success": False, "username": [{ "user_message": ( u"It looks like {} belongs to an existing account. " @@ -1596,7 +1587,6 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase): self.assertDictEqual( response_json, { - u"success": False, u"username": [{u"user_message": USERNAME_BAD_LENGTH_MSG}], u"password": [{u"user_message": u"This field is required."}], } @@ -1761,7 +1751,6 @@ class ThirdPartyRegistrationTestMixin(ThirdPartyOAuthTestMixin, CacheIsolationTe self.assertDictEqual( response_json, { - "success": False, "access_token": [{"user_message": expected_error_message}], } ) @@ -1773,7 +1762,6 @@ class ThirdPartyRegistrationTestMixin(ThirdPartyOAuthTestMixin, CacheIsolationTe self.assertDictEqual( response_json, { - "success": False, "session_expired": [{"user_message": expected_error_message}], } )