diff --git a/license_manager/apps/api/v1/tests/test_license_activation_view.py b/license_manager/apps/api/v1/tests/test_license_activation_view.py index 7adf1f76..0377e7a8 100644 --- a/license_manager/apps/api/v1/tests/test_license_activation_view.py +++ b/license_manager/apps/api/v1/tests/test_license_activation_view.py @@ -152,6 +152,7 @@ def test_activate_an_assigned_license(self, mock_send_post_activation_email_task assert activated_license['status'] == constants.ACTIVATED expected_activation_date = self.now.strftime('%Y-%m-%dT%H:%M:%S.%fZ') assert activated_license['activation_date'] == expected_activation_date + assert activated_license['subscription_plan']['uuid'] == str(license_to_be_activated.subscription_plan.uuid) # Refresh license from the database license_to_be_activated.refresh_from_db() diff --git a/license_manager/apps/api/v1/views.py b/license_manager/apps/api/v1/views.py index 5757b862..7d4579f2 100644 --- a/license_manager/apps/api/v1/views.py +++ b/license_manager/apps/api/v1/views.py @@ -1801,7 +1801,7 @@ def post(self, request): # There's an implied logical branch where the license is already activated # in which case we also return as if the activation action was successful. - serialized_license = serializers.LicenseSerializer(user_license) + serialized_license = serializers.LearnerLicenseSerializer(user_license) return Response(serialized_license.data, status=status.HTTP_200_OK) def _track_and_notify(self, user_license):