-
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
Draft
tecoholic
wants to merge
16
commits into
openedx:master
Choose a base branch
from
open-craft:tecoholic/create-cea-for-invite-only-courses-before-checkout
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+373
−53
Draft
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e562426
temp: add utility function to add CEA objects
tecoholic 95162d5
feat: adds allow invite only enrollment flag
tecoholic f9cb7c7
feat: adds allow invite only enrollment flag
tecoholic a309ab0
feat: create cea only when customer has invite-only enrollments enabled
tecoholic d1dbd69
fix: simplify the cea creation logic, update tests
tecoholic 6007f6b
fix: remove a stray empty line
tecoholic aa51c9c
feat: adds the invite-only flag to customer admin
tecoholic b691e53
fix: typo in the fuction docstring
tecoholic ca44643
refactor: convert the user consent flow handler method to static
tecoholic 920f16c
fix: move migrations to avoid conflicts
tecoholic 73e9703
feat: add typing to the ensure cea utility method
tecoholic e9fafdd
Revert "feat: add typing to the ensure cea utility method"
tecoholic db7aae4
refactor: rename the migration with a custom name instead of the auto…
tecoholic f20fc1a
fix: remove typing that breaks causes import failures
tecoholic e6aab23
chore: move the DB migration to latest version
tecoholic 67f418a
fix: respect allow_enrollment_in_invite_only_courses (#14)
0x29a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
enterprise/migrations/0198_allow_enrollment_in_invite_only_courses.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.23 on 2023-12-08 09:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('enterprise', '0197_auto_20231130_2239'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='enterprisecustomer', | ||
name='allow_enrollment_in_invite_only_courses', | ||
field=models.BooleanField(default=False, help_text="Specifies if learners are allowed to enroll into courses marked as 'invitation-only', when they attempt to enroll from the landing page."), | ||
), | ||
migrations.AddField( | ||
model_name='historicalenterprisecustomer', | ||
name='allow_enrollment_in_invite_only_courses', | ||
field=models.BooleanField(default=False, help_text="Specifies if learners are allowed to enroll into courses marked as 'invitation-only', when they attempt to enroll from the landing page."), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thetyping
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.