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
61e9519b
Commit
61e9519b
authored
Jan 27, 2015
by
Shrhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6709 from edx/shr/bug/TNL-1229-Burst-errors
Invalid youtube_id raise NotFoundError for transcripts
parents
175aeaf4
e2ecb0db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
common/lib/xmodule/xmodule/video_module/video_handlers.py
+4
-1
lms/djangoapps/courseware/tests/test_video_handlers.py
+5
-0
No files found.
common/lib/xmodule/xmodule/video_module/video_handlers.py
View file @
61e9519b
...
...
@@ -104,6 +104,7 @@ class VideoStudentViewHandlers(object):
Raises:
NotFoundError if for 'en' subtitles no asset is uploaded.
NotFoundError if youtube_id does not exist / invalid youtube_id
"""
if
youtube_id
:
# Youtube case:
...
...
@@ -111,7 +112,9 @@ class VideoStudentViewHandlers(object):
return
Transcript
.
asset
(
self
.
location
,
youtube_id
)
.
data
youtube_ids
=
youtube_speed_dict
(
self
)
assert
youtube_id
in
youtube_ids
if
youtube_id
not
in
youtube_ids
:
log
.
info
(
"Youtube_id
%
s does not exist"
,
youtube_id
)
raise
NotFoundError
try
:
sjson_transcript
=
Transcript
.
asset
(
self
.
location
,
youtube_id
,
self
.
transcript_language
)
.
data
...
...
lms/djangoapps/courseware/tests/test_video_handlers.py
View file @
61e9519b
...
...
@@ -322,6 +322,11 @@ class TestTranscriptTranslationGetDispatch(TestVideo):
response
=
self
.
item
.
transcript
(
request
=
request
,
dispatch
=
'translation/ru'
)
self
.
assertEqual
(
response
.
status
,
'404 Not Found'
)
# Youtube_id is invalid or does not exist
request
=
Request
.
blank
(
'/translation/uk?videoId=9855256955511225'
)
response
=
self
.
item
.
transcript
(
request
=
request
,
dispatch
=
'translation/uk'
)
self
.
assertEqual
(
response
.
status
,
'404 Not Found'
)
def
test_translaton_en_youtube_success
(
self
):
subs
=
{
"start"
:
[
10
],
"end"
:
[
100
],
"text"
:
[
"Hi, welcome to Edx."
]}
good_sjson
=
_create_file
(
json
.
dumps
(
subs
))
...
...
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