AA-253: don't send outline if not enrolled

This is for the learning MFE outline endpoint.

Also clean up some related permissions issues.
This commit is contained in:
Michael Terry
2020-09-25 15:44:48 -04:00
parent 8e1ea3e536
commit 100018081d
4 changed files with 85 additions and 62 deletions

View File

@@ -34,6 +34,7 @@ from lms.djangoapps.courseware.toggles import REDIRECT_TO_COURSEWARE_MICROFRONTE
from lms.djangoapps.courseware.utils import can_show_verified_upgrade
from lms.djangoapps.courseware.utils import verified_upgrade_deadline_link
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin
from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
from openedx.features.course_duration_limits.access import generate_course_expired_message
from openedx.features.discounts.utils import generate_offer_html
@@ -132,8 +133,8 @@ class CoursewareMeta:
@property
def can_show_upgrade_sock(self):
can_show = can_show_verified_upgrade(self.effective_user, self.enrollment_object)
return can_show
return (DISPLAY_COURSE_SOCK_FLAG.is_enabled(self.course_key) and
can_show_verified_upgrade(self.effective_user, self.enrollment_object))
@property
def license(self):