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
e915a32a
Commit
e915a32a
authored
Mar 05, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xblock save only affects draft
Fix test which caused error
parent
41f5159b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
15 deletions
+9
-15
cms/djangoapps/contentstore/views/component.py
+3
-6
cms/djangoapps/contentstore/views/item.py
+3
-6
cms/djangoapps/contentstore/views/tests/test_item.py
+3
-3
No files found.
cms/djangoapps/contentstore/views/component.py
View file @
e915a32a
...
...
@@ -26,7 +26,7 @@ from xblock.runtime import Mixologist
from
lms.lib.xblock.runtime
import
unquote_slashes
from
contentstore.utils
import
get_lms_link_for_item
,
compute_unit_state
,
UnitState
from
contentstore.utils
import
get_lms_link_for_item
,
compute_unit_state
,
UnitState
,
get_modulestore
from
contentstore.views.helpers
import
get_parent_xblock
from
models.settings.course_grading
import
CourseGradingModel
...
...
@@ -358,7 +358,7 @@ def component_handler(request, usage_id, handler, suffix=''):
location
=
unquote_slashes
(
usage_id
)
descriptor
=
modulestore
(
)
.
get_item
(
location
)
descriptor
=
get_modulestore
(
location
)
.
get_item
(
location
)
# Let the module handle the AJAX
req
=
django_to_webob_request
(
request
)
...
...
@@ -371,9 +371,6 @@ def component_handler(request, usage_id, handler, suffix=''):
# unintentional update to handle any side effects of handle call; so, request user didn't author
# the change
if
getattr
(
descriptor
,
'is_draft'
,
False
):
modulestore
(
'draft'
)
.
update_item
(
descriptor
,
None
)
else
:
modulestore
(
'direct'
)
.
update_item
(
descriptor
,
None
)
get_modulestore
(
location
)
.
update_item
(
descriptor
,
None
)
return
webob_to_django_response
(
resp
)
cms/djangoapps/contentstore/views/item.py
View file @
e915a32a
...
...
@@ -202,12 +202,9 @@ def xblock_view_handler(request, package_id, view_name, tag=None, branch=None, v
log
.
debug
(
"unable to render studio_view for
%
r"
,
component
,
exc_info
=
True
)
fragment
=
Fragment
(
render_to_string
(
'html_error.html'
,
{
'message'
:
str
(
exc
)}))
# change not authored by requestor but by xblocks. should not convert to draft if not
# already draft
if
getattr
(
component
,
'is_draft'
,
False
):
modulestore
(
'draft'
)
.
update_item
(
component
,
None
)
else
:
modulestore
(
'direct'
)
.
update_item
(
component
,
None
)
# change not authored by requestor but by xblocks.
store
.
update_item
(
component
,
None
)
elif
view_name
==
'student_view'
and
component
.
has_children
:
# For non-leaf xblocks on the unit page, show the special rendering
# which links to the new container page.
...
...
cms/djangoapps/contentstore/views/tests/test_item.py
View file @
e915a32a
...
...
@@ -636,11 +636,11 @@ class TestComponentHandler(TestCase):
def
setUp
(
self
):
self
.
request_factory
=
RequestFactory
()
patcher
=
patch
(
'contentstore.views.component.modulestore'
)
self
.
modulestore
=
patcher
.
start
()
patcher
=
patch
(
'contentstore.views.component.
get_
modulestore'
)
self
.
get_
modulestore
=
patcher
.
start
()
self
.
addCleanup
(
patcher
.
stop
)
self
.
descriptor
=
self
.
modulestore
.
return_value
.
get_item
.
return_value
self
.
descriptor
=
self
.
get_
modulestore
.
return_value
.
get_item
.
return_value
self
.
usage_id
=
'dummy_usage_id'
...
...
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