Opencraft/edx platform/devan/show enroll links on public courses only if self enrollment allowed #19897
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.
This PR changes the logic for displaying enroll messages on the course home page.
With this change, public courses will show "Enroll" links only if self-enrollment is allowed
Discussions: Link to any public dicussions about this PR or the design/architecture. Otherwise omit this.
Screenshots:


View when User is unenrolled for Public Outline course (invite-only), before change.
View when User is unenrolled for Public Outline course (invite-only), after change.
View when User is unenrolled for Public course (self-enrollment allowed), before change.


View when User is unenrolled for Public course (self-enrollment allowed), after change.
View when User is anonymous for Public course (self-enrollment allowed), before change.


View when User is anonymous for Public course (self-enrollment allowed), after change.
Sandbox URL:
Studio:https://studio-pr19837.sandbox.opencraft.hosting/
LMS:https://pr19837.sandbox.opencraft.hosting/
Merge deadline:"None"
Testing instructions:
Contains 2 courses:
[edX Demo Course] has
seo.enable_anonymous_courseware_accesscourse waffle flag, and the "Advanced Settings > Course Visibility For Unenrolled Learners" set to public_outline and the "Advanced Settings > Invitation Only " set to true.https://pr19837.sandbox.opencraft.hosting/courses/course-v1:edX+DemoX+Demo_Course/
[Test Course] has
seo.enable_anonymous_courseware_accesscourse waffle flag, and the "Advanced Settings > Course Visibility For Unenrolled Learners" set to public and the "Advanced Settings > Invitation Only " set to false.https://pr19837.sandbox.opencraft.hosting/courses/course-v1:opencraft+test01+2019_T1/
Go to LMS
Sign in
View the edX Demo Course course page
You should not see an Enroll message
Go to LMS
Sign in
View the Test Course course page of the public course you've created
You should see an Enroll message
Open the same link in an anonymous browser
You should not see an Enroll message
Reviewers