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

feat: cherry-pick edx-enterprise customizations to Quince [BB-8368] #13

Merged

Conversation

0x29a
Copy link
Member

@0x29a 0x29a commented Dec 30, 2023

Description

This PR is very similar to the previous one: #10.

Differences:

Testing instructions

I'm not providing testing instructions, as there again were many Quince devstack quirks and new edx-enterprise quirks. But, I carefully tested every feature.

0x29a and others added 2 commits December 30, 2023 11:04
Co-authored-by: Maxim Beder <[email protected]>

test: EnterpriseCourseEnrollmentFilterBackend

Co-authored-by: Maxim Beder <[email protected]>

feat: add additional fields to EnterpriseCourseEnrollmentViewSet

Created new manager and serializer for EnterpriseCourseEnrollment model,
which add additional fields to the model, which allow to reduce the
number of requests to the API by providing the necessary data in the
feilds along side the model.

Use the new manager and serializer in EnterpriseCourseEnrollmentViewSet.

Co-authored-by: Maxim Beder <[email protected]>

perf: order enterprise course enrollments by id

perf: strip annotations for paginator's count

perf: use read replica or default
When creating pending enrollments for non-existant users, we also check
to see if the course is "invite_only". If the course is invite only,
then we create corresponding CourseEnrollmentAllowed objects. This fixes
the issue when the enterprise creates pending enrollment, but the user
cannot enroll to the course as platform rejects the enrollment request
due to missing CEA for the user.

(cherry picked from commit 2d8c2d4)
@0x29a 0x29a changed the title feat: cherry-pick edx-enterprise customizations to Palm [BB-8368] feat: cherry-pick edx-enterprise customizations to Quince [BB-8368] Dec 30, 2023
This adds a new attribute `hide_course_price_when_zero` to the
EnterpriseCustomer model, which will hide the pricing information
from the enrollment page when the final price of a premium course
mode is Zero.

fix: removed unused variable from template context

fix: quality issue and add the new attribute to test

fix: update the help text in the db migration

feat: adds final price to logging

fix: change the attribute in the utils test causing test failure

refactor: renamed the migration file

chore: rebase on master and update db migration

fix: remove empty lines causing linting failure

fix: remove the empty line in tests file

-------------------------

Additionally includes this fix:
https://tasks.opencraft.com/browse/BB-7541?focusedCommentId=282910&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-282910
@0x29a 0x29a force-pushed the 0x29a/bb8368/port-edx-enterprise-code-drift branch from 584d619 to 03dfb72 Compare December 30, 2023 16:15
tecoholic and others added 5 commits December 30, 2023 17:40
feat: adds allow invite only enrollment flag

feat: adds allow invite only enrollment flag

feat: create cea only when customer has invite-only enrollments enabled

fix: simplify the cea creation logic, update tests

fix: remove a stray empty line

feat: adds the invite-only flag to customer admin

fix: typo in the fuction docstring

Co-authored-by: Piotr Surowiec <[email protected]>

refactor: convert the user consent flow handler method to static

fix: move migrations to avoid conflicts

feat: add typing to the ensure cea utility method

Revert "feat: add typing to the ensure cea utility method"

This reverts commit b6b2f25.

refactor: rename the migration with a custom name instead of the auto one

fix: remove typing that breaks causes import failures

chore: move the DB migration to latest version

-----------------------

Additionally includes this fix:
https://tasks.opencraft.com/browse/BB-7619?focusedCommentId=282911&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-282911
This commit contains renamed migrations that were extracted from other
pull requests. We do this because upstream PRs depend on migrations that
don't exist in v4.6.0

IMPORTANT: if you've previously had `opencraft-release/palm.1`
installed, you'll have to fake `0194_hide_course_price_when_zero` and `0195_allow_enrollment_in_invite_only_courses`
migrations from this commit, as changes are most likely already applied to your DB.

See this and further comments for details: https://tasks.opencraft.com/browse/BB-7619?focusedCommentId=274168&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-274168

Also see the similar commit for nutmeg: 9840c0b
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0x29a, this looks great; thanks for working on it and describing the differences in the PRs description + commit messages!

Just one request: would you like to open a small PR to upstream ff5da2d? It can be a one-liner, as it doesn't need a version bump or anything else.

👍

  • I tested this: read through the diffs, checked them with the previous cherry-pick PR and relevant upstream PRs
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository: n/a

@0x29a
Copy link
Member Author

0x29a commented Jan 3, 2024

Thank you for the review, @Agrendalath!

Just one request: would you like to open a small PR to upstream ff5da2d? It can be a one-liner, as it doesn't need a version bump or anything else.

Sure, here it is: openedx#1978

@0x29a 0x29a merged commit d1c1995 into opencraft-release/quince.1 Jan 3, 2024
7 checks passed
@0x29a 0x29a deleted the 0x29a/bb8368/port-edx-enterprise-code-drift branch January 3, 2024 09:33
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