-
Notifications
You must be signed in to change notification settings - Fork 48
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: create cea for invite only courses before checkout #1813
base: master
Are you sure you want to change the base?
feat: create cea for invite only courses before checkout #1813
Conversation
Thanks for the pull request, @tecoholic! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently unmaintained. To get help with finding a technical reviewer, tag the community contributions project manager for this PR in a comment and let them know that your changes are ready for review:
Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Hi @tecoholic! Is this ready for review? |
@mphilbrick211 Yes. It is. However, I am considering creating a issue/proposal collecting a couple of other related PRs and submitted them all together for a someone on the project team to take a look. So, we can take it a bit slow if needed. |
Gotcha. Sounds good. I'll check back in, or just ping me when you're all set! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- I tested this: checked that the CEA is created
- 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
Arguments: | ||
course_id (str): ID of the course to allow enrollment | ||
email (str): email of the user whose enrollment should be allowed | ||
enrollment_api_client (:class:`enterprise.api_client.lms.EnrollmentApiClient`): Enrollment API Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit: wouldn't it be better to move the typing directly to the arguments (line 2313)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Agrendalath Probably. But the file doesn't use inline types anywhere and instead uses types in docstrings. So I decided to just follow the convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tecoholic, typing
(in its current form) is a relatively recent feature in Python, so most people tend to forget about it. While following the convention is important, we should also be open to introducing apparent improvements. We are already gradually adding the typing
to more and more repositories in Open edX. Examples: openedx/edx-platform#32591, openedx/opaque-keys#256.
This is not a blocker here, but something to be aware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Agrendalath Alright, in that case, let this PR be the one to bring in the change. I have added the typing for the utility function introduced in this PR.
1295492
to
98e7508
Compare
@mphilbrick211 when we have an indication of timing of the review, we need to ask @tecoholic to rebase the branch. |
Hi @openedx/enterprise-titans! Would someone be able to please review/merge this for us? CC: @tecoholic |
Hi @tecoholic! Looks like some branch conflicts have popped up - would you mind having a look? |
Hi @openedx/enterprise-titans! Just checking in to see if someone is able to review/merge this for us? If so, we'll resolve the branch conflicts to proceed. Thanks! |
Checking in on this @openedx/enterprise-titans |
2ffbb30
to
1ce437f
Compare
eca2b66
to
03dd9bb
Compare
Co-authored-by: Piotr Surowiec <[email protected]>
This reverts commit b6b2f25.
03dd9bb
to
e6aab23
Compare
@openedx/enterprise-titans The PR has been rebased on master and the DB migration updated to the latest version. Kindly review. cc: @e0d |
Hi @openedx/2u-titans! If you're still reviewing pull requests, would you please be able to review / merge this for us? Thanks! |
* fix: respect allow_enrollment_in_invite_only_courses Fixes `enroll_learners_in_courses` endpoint (and `enroll_subsidy_users_in_courses` utility function) to respect enterprise customer's `allow_enrollment_in_invite_only_courses` flag. * fix: create CEA object when enrolling using a license flow (#18)
NOTE The PR has been moved to draft to rework the changes.
Description
This allows enterprise learners whose enterprise catalog contains private "invitation only" courses to enroll without having to be explicitly invited.
This adds a new flag to the
EnterpriseCustomer
models calledallow_enrollment_in_invite_only_courses
. Once this is enabled, the enrollment POST request will check if the course is "invite-only" and create aCourseEnrollmentAllowed
object in the platform if required.Testing instructions
The following instruction assume you are using the devstack setup for testing.
true
.http://localhost:18000/enterprise/<enterprise-id>/course/<course-key>/enroll/?catalog=<catalog-id>&utm_medium=enterprise&utm_source=test-enterprise
. This should be obtainable from the enterprise API{{base_url}}/enterprise/api/v1/enterprise_catalogs/{{catalog_id}}/
make lms-shell && pip install -e /edx/src/edx-enterprise
python manage.py lms migrate
Merge checklist:
requirements/*.txt
files)base.in
if needed in production but edx-platform doesn't install ittest-master.in
if edx-platform pins it, with a matching versionmake upgrade && make requirements
have been run to regenerate requirementsmake static
has been run to update webpack bundling if any static content was updated./manage.py makemigrations
has been run./manage.py lms makemigrations
in the shell.Post merge:
(so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
make upgrade
in edx-platform will look for the latest version in PyPi.Internal Ref