forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the default enrollment start date on course creation (openedx#30954)
* fix: main page course listing The course is visible on the main page right after creation when the feature toggle `CREATE_COURSE_WITH_DEFAULT_ENROLLMENT_START_DATE` is on. So anonymous users can see them and access the course about page for the courses without valid data (e.g. they will see the default course overview) When courses list filtering is processed it checks the `see_exists` permission for the anonymous user. Actually, `see_exists` means `can_load` OR `can_enroll`. `can_load` is False in our case because the course start in the future. But `can_enroll` returns True because the course's enrollment_start and enrollment_end dates are blank: ``` enrollment_start = courselike.enrollment_start or datetime.min.replace(tzinfo=UTC) enrollment_end = courselike.enrollment_end or datetime.max.replace(tzinfo=UTC) if enrollment_start < now < enrollment_end: debug("Allow: in enrollment period") return ACCESS_GRANTED ``` Set the enrollment_start the same as a course start by default
- Loading branch information
1 parent
bdbc4fa
commit 4bba8df
Showing
4 changed files
with
75 additions
and
25 deletions.
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