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
d2ffca2c
Commit
d2ffca2c
authored
Jul 31, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unneccesary checks for method existence
parent
f3d76e69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
common/lib/xmodule/xmodule/modulestore/__init__.py
+12
-4
No files found.
common/lib/xmodule/xmodule/modulestore/__init__.py
View file @
d2ffca2c
...
@@ -657,15 +657,23 @@ class ModuleStoreWriteBase(ModuleStoreReadBase, ModuleStoreWrite):
...
@@ -657,15 +657,23 @@ class ModuleStoreWriteBase(ModuleStoreReadBase, ModuleStoreWrite):
# it's ok if the cached metadata in the memcache is invalid when another
# it's ok if the cached metadata in the memcache is invalid when another
# request comes in for the same course.
# request comes in for the same course.
try
:
try
:
if
hasattr
(
self
,
'_begin_bulk_write_operation'
):
self
.
_begin_bulk_write_operation
(
course_id
)
self
.
_begin_bulk_write_operation
(
course_id
)
yield
yield
finally
:
finally
:
# check for the begin method here,
# since it's an error if an end method is not defined when a begin method is
if
hasattr
(
self
,
'_begin_bulk_write_operation'
):
self
.
_end_bulk_write_operation
(
course_id
)
self
.
_end_bulk_write_operation
(
course_id
)
def
_begin_bulk_write_operation
(
self
,
course_id
):
"""
Begin a bulk write operation on course_id.
"""
pass
def
_end_bulk_write_operation
(
self
,
course_id
):
"""
End the active bulk write operation on course_id.
"""
pass
def
only_xmodules
(
identifier
,
entry_points
):
def
only_xmodules
(
identifier
,
entry_points
):
"""Only use entry_points that are supplied by the xmodule package"""
"""Only use entry_points that are supplied by the xmodule package"""
...
...
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