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
eec19992
Commit
eec19992
authored
Nov 25, 2014
by
Syed Hassan Raza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle unicode through try catch
parent
b3e7516a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
common/lib/xmodule/xmodule/video_module/video_handlers.py
+1
-3
lms/djangoapps/courseware/tests/test_video_handlers.py
+1
-1
No files found.
common/lib/xmodule/xmodule/video_module/video_handlers.py
View file @
eec19992
...
@@ -55,9 +55,7 @@ class VideoStudentViewHandlers(object):
...
@@ -55,9 +55,7 @@ class VideoStudentViewHandlers(object):
if
dispatch
==
'save_user_state'
:
if
dispatch
==
'save_user_state'
:
for
key
in
data
:
for
key
in
data
:
if
type
(
key
)
==
str
:
if
key
in
accepted_keys
:
key
=
unicode
(
key
,
"UTF8"
)
if
hasattr
(
self
,
key
.
encode
(
'utf8'
))
and
key
in
accepted_keys
:
if
key
in
conversions
:
if
key
in
conversions
:
value
=
conversions
[
key
](
data
[
key
])
value
=
conversions
[
key
](
data
[
key
])
else
:
else
:
...
...
lms/djangoapps/courseware/tests/test_video_handlers.py
View file @
eec19992
...
@@ -153,7 +153,7 @@ class TestVideo(BaseTestXmodule):
...
@@ -153,7 +153,7 @@ class TestVideo(BaseTestXmodule):
self
.
item_descriptor
.
handle_ajax
(
'save_user_state'
,
{
'transcript_language'
:
"uk"
})
self
.
item_descriptor
.
handle_ajax
(
'save_user_state'
,
{
'transcript_language'
:
"uk"
})
self
.
assertEqual
(
self
.
item_descriptor
.
transcript_language
,
'uk'
)
self
.
assertEqual
(
self
.
item_descriptor
.
transcript_language
,
'uk'
)
response
=
self
.
item_descriptor
.
handle_ajax
(
'save_user_state'
,
{
'demoo�'
:
"sample"
})
response
=
self
.
item_descriptor
.
handle_ajax
(
'save_user_state'
,
{
u
'demoo�'
:
"sample"
})
self
.
assertEqual
(
json
.
loads
(
response
)[
'success'
],
True
)
self
.
assertEqual
(
json
.
loads
(
response
)[
'success'
],
True
)
...
...
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