Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schoolyourself-xblock
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
OpenEdx
schoolyourself-xblock
Commits
7e2ad35c
Commit
7e2ad35c
authored
Apr 17, 2015
by
John Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch ValueError around the calls to float() rather than swallowing everything
parent
0c88d25e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
schoolyourself/schoolyourself_review.py
+2
-2
No files found.
schoolyourself/schoolyourself_review.py
View file @
7e2ad35c
...
@@ -118,7 +118,7 @@ class SchoolYourselfReviewXBlock(SchoolYourselfXBlock):
...
@@ -118,7 +118,7 @@ class SchoolYourselfReviewXBlock(SchoolYourselfXBlock):
# The mastery level being passed in should be a number, otherwise
# The mastery level being passed in should be a number, otherwise
# things later on in this method will choke.
# things later on in this method will choke.
mastery_level
=
float
(
mastery_level
)
mastery_level
=
float
(
mastery_level
)
except
:
except
ValueError
:
return
"bad_request"
return
"bad_request"
# Verify the signature.
# Verify the signature.
...
@@ -129,7 +129,7 @@ class SchoolYourselfReviewXBlock(SchoolYourselfXBlock):
...
@@ -129,7 +129,7 @@ class SchoolYourselfReviewXBlock(SchoolYourselfXBlock):
# Every entry should be a number.
# Every entry should be a number.
try
:
try
:
mastery
[
key
]
=
float
(
mastery
[
key
])
mastery
[
key
]
=
float
(
mastery
[
key
])
except
:
except
ValueError
:
return
"bad_request"
return
"bad_request"
verifier
.
update
(
"
%.2
f"
%
mastery
[
key
])
verifier
.
update
(
"
%.2
f"
%
mastery
[
key
])
...
...
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