Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use LearnerLicenseSerializer in LicenseActivationView #741

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion license_manager/apps/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down