Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0ed4ee32
Commit
0ed4ee32
authored
10 years ago
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use bulk operations on get_course_by_id and courseware
parent
0c795934
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
lms/djangoapps/courseware/courses.py
+2
-1
lms/djangoapps/courseware/views.py
+5
-0
No files found.
lms/djangoapps/courseware/courses.py
View file @
0ed4ee32
...
...
@@ -66,7 +66,8 @@ def get_course_by_id(course_key, depth=0):
depth: The number of levels of children for the modulestore to cache. None means infinite depth
"""
course
=
modulestore
()
.
get_course
(
course_key
,
depth
=
depth
)
with
modulestore
()
.
bulk_operations
(
course_key
):
course
=
modulestore
()
.
get_course
(
course_key
,
depth
=
depth
)
if
course
:
return
course
else
:
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/views.py
View file @
0ed4ee32
...
...
@@ -285,6 +285,11 @@ def index(request, course_id, chapter=None, section=None,
return
redirect
(
reverse
(
'dashboard'
))
request
.
user
=
user
# keep just one instance of User
with
modulestore
()
.
bulk_operations
(
course_key
):
return
_index_bulk_op
(
request
,
user
,
course_key
,
chapter
,
section
,
position
)
def
_index_bulk_op
(
request
,
user
,
course_key
,
chapter
,
section
,
position
):
course
=
get_course_with_access
(
user
,
'load'
,
course_key
,
depth
=
2
)
staff_access
=
has_access
(
user
,
'staff'
,
course
)
registered
=
registered_for_course
(
course
,
user
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment