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
0c4511b5
Commit
0c4511b5
authored
6 years ago
by
attiyaishaque
Browse files
Options
Downloads
Patches
Plain Diff
Fix that when usage key none is not raise error.
parent
f506e347
No related branches found
Branches containing commit
Tags
release-2018-12-12-12.20
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/seq_module.py
+2
-0
2 additions, 0 deletions
common/lib/xmodule/xmodule/seq_module.py
common/lib/xmodule/xmodule/tests/test_sequence.py
+12
-0
12 additions, 0 deletions
common/lib/xmodule/xmodule/tests/test_sequence.py
with
14 additions
and
0 deletions
common/lib/xmodule/xmodule/seq_module.py
+
2
−
0
View file @
0c4511b5
...
...
@@ -212,6 +212,8 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule):
completion_service
=
self
.
runtime
.
service
(
self
,
'
completion
'
)
usage_key
=
data
.
get
(
'
usage_key
'
,
None
)
if
not
usage_key
:
return
None
item
=
self
.
get_child
(
UsageKey
.
from_string
(
usage_key
))
if
not
item
:
return
None
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/tests/test_sequence.py
+
12
−
0
View file @
0c4511b5
...
...
@@ -296,3 +296,15 @@ class SequenceBlockTestCase(XModuleXmlImportTest):
self
.
assertIsNot
(
completion_return
,
None
)
self
.
assertTrue
(
'
complete
'
in
completion_return
)
self
.
assertEqual
(
completion_return
[
'
complete
'
],
True
)
def
test_handle_ajax_get_completion_return_none
(
self
):
"""
Test that the completion data is returned successfully None
when usage key is None through ajax call
"""
usage_key
=
None
completion_return
=
self
.
sequence_3_1
.
handle_ajax
(
'
get_completion
'
,
{
'
usage_key
'
:
usage_key
}
)
self
.
assertIs
(
completion_return
,
None
)
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