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
e77a67a9
Commit
e77a67a9
authored
Dec 13, 2012
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect against graceperiodjson being null.
r.don
parent
aee4fd91
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
cms/djangoapps/models/settings/course_grading.py
+6
-4
No files found.
cms/djangoapps/models/settings/course_grading.py
View file @
e77a67a9
from
xmodule.modulestore
import
Location
from
contentstore.utils
import
get_modulestore
import
datetime
import
re
from
util
import
converters
import
time
class
CourseGradingModel
:
...
...
@@ -145,11 +143,15 @@ class CourseGradingModel:
def
update_grace_period_from_json
(
course_location
,
graceperiodjson
):
"""
Update the course's default grace period. Incoming dict is {hours: h, minutes: m} possibly as a
grace_period entry in an enclosing dict.
grace_period entry in an enclosing dict. It is also safe to call this method with a value of
None for graceperiodjson.
"""
if
not
isinstance
(
course_location
,
Location
):
course_location
=
Location
(
course_location
)
# Before a graceperiod has ever been created, it will be None (once it has been
# created, it cannot be set back to None).
if
graceperiodjson
is
not
None
:
if
'grace_period'
in
graceperiodjson
:
graceperiodjson
=
graceperiodjson
[
'grace_period'
]
...
...
@@ -171,7 +173,7 @@ class CourseGradingModel:
index
=
int
(
index
)
if
index
<
len
(
descriptor
.
raw_grader
):
del
descriptor
.
raw_grader
[
index
]
# force propagation to defintion
# force propagation to defin
i
tion
descriptor
.
raw_grader
=
descriptor
.
raw_grader
get_modulestore
(
course_location
)
.
update_item
(
course_location
,
descriptor
.
definition
[
'data'
])
...
...
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