Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
51803d33
Commit
51803d33
authored
4 years ago
by
stvn
Browse files
Options
Downloads
Patches
Plain Diff
Check if user can upgrade prior to showing sock upgrade
parent
599adebf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/djangoapps/courseware_api/serializers.py
+1
-0
1 addition, 0 deletions
openedx/core/djangoapps/courseware_api/serializers.py
openedx/core/djangoapps/courseware_api/views.py
+7
-0
7 additions, 0 deletions
openedx/core/djangoapps/courseware_api/views.py
with
8 additions
and
0 deletions
openedx/core/djangoapps/courseware_api/serializers.py
+
1
−
0
View file @
51803d33
...
...
@@ -61,6 +61,7 @@ class CourseInfoSerializer(serializers.Serializer): # pylint: disable=abstract-
Compare this with CourseDetailSerializer.
"""
can_show_upgrade_sock
=
serializers
.
BooleanField
()
content_type_gating_enabled
=
serializers
.
BooleanField
()
course_expired_message
=
serializers
.
CharField
()
effort
=
serializers
.
CharField
()
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/courseware_api/views.py
+
7
−
0
View file @
51803d33
...
...
@@ -20,6 +20,7 @@ from lms.djangoapps.courseware.access import has_access
from
lms.djangoapps.courseware.courses
import
check_course_access
from
lms.djangoapps.courseware.module_render
import
get_module_by_usage_id
from
lms.djangoapps.courseware.tabs
import
get_course_tab_list
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.content_type_gating.models
import
ContentTypeGatingConfig
...
...
@@ -82,6 +83,12 @@ class CoursewareMeta:
course_key
=
self
.
course_key
,
)
@property
def
can_show_upgrade_sock
(
self
):
enrollment
=
CourseEnrollment
.
get_enrollment
(
self
.
effective_user
,
self
.
course_key
)
can_show
=
can_show_verified_upgrade
(
self
.
effective_user
,
enrollment
)
return
can_show
@property
def
can_load_courseware
(
self
):
return
check_course_access
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment