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
8a527d16
Commit
8a527d16
authored
Aug 09, 2013
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error when there is an invalid YouTube property in a video module
parent
a7568fbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
common/lib/xmodule/xmodule/video_module.py
+8
-10
No files found.
common/lib/xmodule/xmodule/video_module.py
View file @
8a527d16
...
@@ -287,19 +287,17 @@ class VideoDescriptor(VideoFields, TabsEditingDescriptor, EmptyDataRawDescriptor
...
@@ -287,19 +287,17 @@ class VideoDescriptor(VideoFields, TabsEditingDescriptor, EmptyDataRawDescriptor
XML-based courses.
XML-based courses.
"""
"""
ret
=
{
'0.75'
:
''
,
'1.00'
:
''
,
'1.25'
:
''
,
'1.50'
:
''
}
ret
=
{
'0.75'
:
''
,
'1.00'
:
''
,
'1.25'
:
''
,
'1.50'
:
''
}
if
data
==
''
:
return
ret
videos
=
data
.
split
(
','
)
videos
=
data
.
split
(
','
)
for
video
in
videos
:
for
video
in
videos
:
pieces
=
video
.
split
(
':'
)
pieces
=
video
.
split
(
':'
)
# HACK
try
:
# To elaborate somewhat: in many LMS tests, the keys for
speed
=
'
%.2
f'
%
float
(
pieces
[
0
])
# normalize speed
# Youtube IDs are inconsistent. Sometimes a particular
youtube_id
=
pieces
[
1
]
# speed isn't present, and formatting is also inconsistent
ret
[
speed
]
=
youtube_id
# ('1.0' versus '1.00'). So it's necessary to either do
except
(
ValueError
,
IndexError
):
# something like this or update all the tests to work
log
.
warning
(
'Invalid YouTube ID:
%
s'
%
video
)
# properly.
ret
[
'
%.2
f'
%
float
(
pieces
[
0
])]
=
pieces
[
1
]
return
ret
return
ret
@staticmethod
@staticmethod
...
...
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