-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: add new course access error_code for enterprise learners in future courses #33913
Conversation
Arguments: | ||
display_error_to_user: If True, display this error to users in the UI. | ||
""" | ||
error_code = "course_not_started_enterprise_learner" |
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.
here's the error_code to match up in the case statement on the frontend.
436dbeb
to
67ef00d
Compare
8cc79fb
to
c417aa8
Compare
d0aa6b3
to
583a56b
Compare
…ure courses Normally, the course API would return an access error_code of `course_not_started` if the course has not started yet. This change breaks that up into two codes: * if the course has not started: * return error_code=`course_not_started_enterprise_learner` if the learner is enrolled as a subsidized enterprise learner. * else, return error_code=`course_not_started`. This supports a change to the frontend which will interpret `course_not_started_enterprise_learner` differently and trigger a redirect to the enterprise (B2B) learner dashboard instead of the B2C dashboard. ENT-8078
583a56b
to
287a7ff
Compare
I just incorporated
|
@@ -75,6 +76,7 @@ def check_start_date(user, days_early_for_beta, start, course_key, display_error | |||
Returns: | |||
AccessResponse: Either ACCESS_GRANTED or StartDateError. | |||
""" | |||
from openedx.features.enterprise_support.api import enterprise_customer_from_session_or_learner_data |
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.
Don't really understand what's going on here, but adding this at the top of the file caused a circular import error. This pattern is used elsewhere in this same file so I just copied it.
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
Normally, the course API would return an access error_code of
course_not_started
if the course has not started yet. This change breaks that up into two codes:course_not_started_enterprise_learner
if the learner is enrolled as a subsidized enterprise learner.course_not_started
.This supports a change to the frontend which will interpret
course_not_started_enterprise_learner
differently and trigger a redirect to the enterprise (B2B) learner dashboard instead of the B2C dashboard.ENT-8078
Supporting information
Companion PR: openedx/frontend-app-learning#1251