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
54731383
Commit
54731383
authored
Oct 02, 2014
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4003 from edx/pmitros/fix-sequential-none
Fix case where DB gets populated with string None
parents
4e796c57
0c51a98f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
common/lib/xmodule/xmodule/seq_module.py
+13
-3
No files found.
common/lib/xmodule/xmodule/seq_module.py
View file @
54731383
import
json
import
json
import
logging
import
logging
import
warnings
from
lxml
import
etree
from
lxml
import
etree
...
@@ -58,9 +59,18 @@ class SequenceModule(SequenceFields, XModule):
...
@@ -58,9 +59,18 @@ class SequenceModule(SequenceFields, XModule):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
SequenceModule
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
SequenceModule
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
# if position is specified in system, then use that instead
# If position is specified in system, then use that instead
if
getattr
(
self
.
system
,
'position'
,
None
)
is
not
None
:
# This code was made robust to avoid issues like LMS-2799 in
self
.
position
=
int
(
self
.
system
.
position
)
# Jira. We do not know whether this issue is still present,
# but regardless, we'd like to follow:
# http://en.wikipedia.org/wiki/Robustness_principle
position
=
getattr
(
self
.
system
,
'position'
,
None
)
if
position
is
not
None
:
try
:
self
.
position
=
int
(
self
.
system
.
position
)
except
(
ValueError
,
TypeError
):
warnings
.
warn
(
"Sequential position is an invalid type."
,
RuntimeWarning
)
def
get_progress
(
self
):
def
get_progress
(
self
):
''' Return the total progress, adding total done and total available.
''' Return the total progress, adding total done and total available.
...
...
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