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: support force_enrollment in serializers used by bulk enrollment #2073

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

pwnage101
Copy link
Contributor

@pwnage101 pwnage101 commented Apr 16, 2024

ENT-8788

Testing

Before this PR (force_enrollment key was ignored from input):

$ python manage.py shell
>>> from enterprise.api.v1.serializers import EnterpriseCustomerBulkSubscriptionEnrollmentsSerializer
>>> serializer = EnterpriseCustomerBulkSubscriptionEnrollmentsSerializer(data={'enrollments_info': [{'email': '[email protected]', 'course_run_key': 'course-v1:edX+DemoX+Demo_Course', 'license_uuid': '5b77bdbade7b4fcb838f8111b68e18ae', 'force_enrollment': True}]})
>>> serializer.is_valid()
True
>>> serializer.validated_data.get('enrollments_info')[0].get('force_enrollment', False)
False

After this PR:

$ python manage.py shell
>>> from enterprise.api.v1.serializers import EnterpriseCustomerBulkSubscriptionEnrollmentsSerializer
>>> serializer = EnterpriseCustomerBulkSubscriptionEnrollmentsSerializer(data={'enrollments_info': [{'email': '[email protected]', 'course_run_key': 'course-v1:edX+DemoX+Demo_Course', 'license_uuid': '5b77bdbade7b4fcb838f8111b68e18ae', 'force_enrollment': True}]})
>>> serializer.is_valid()
True
>>> serializer.validated_data.get('enrollments_info')[0].get('force_enrollment', False)
True

@pwnage101 pwnage101 force-pushed the pwnage101/ENT-8788 branch 4 times, most recently from 43474df to b769237 Compare April 17, 2024 22:40
@pwnage101 pwnage101 marked this pull request as ready for review April 17, 2024 22:40
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-8788 branch 2 times, most recently from d16d010 to f624d48 Compare April 18, 2024 16:53
@pwnage101 pwnage101 merged commit aee4934 into master Apr 22, 2024
8 checks passed
@pwnage101 pwnage101 deleted the pwnage101/ENT-8788 branch April 22, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants