Learner who have already earned PDF honor certificates in old courses
are unable to see the certificate links on dashboard and course progress
pages since `course.cert_html_view_enabled` is deprecated and default to
True for all courses.
PROD-60
[TNL-7051] Clicking a video XBlock's fullscreen button now takes the video fullscreen instead of full window.
Gracefully fallback to full window if fullscreen apis are absent
The Video Player XBlock will sometimes make API calls to /couses/yt_video_metadata, a REST API endpoint that in turn loads video metadata from YouTube using the configured settings.YOUTUBE_API_KEY.
However, in the Blockstore-based XBlock runtime, we are running XBlocks in a secure sandbox, and the user's browser cannot pass session cookies when calling REST API endpoints. So currently, the video XBlock tries to request YouTube metadata from that API endpoint, but it fails if run within such a sandbox.
The existing API also doesn't work for anonymous users (users who are allowed to see video XBlocks but who have not logged in to an LMS user account).
This commit updates the Video XBlock so that it can use a handler to load the data from YouTube instead of a generic REST API. This works well in the new runtime, because it has code to support calling handlers within the sandbox, including by anonymous users.
I also fixed a bug where on a default devstack, the endpoint will try calling YouTube using PUT_YOUR_API_KEY_HERE as an API key, and get a "bad request" error from YouTube.
The code could be re-organized by moving things around, but I've left everything as-is for now to keep the diff as small as possible.
This is step 3 of DE-1824.
Also update:
* six 1.13.0 => 1.14.0
* edx-django-utils 2.0.2 => 2.0.3
* skip test that checks all model changes have migrations. (We defer
this to step 4.)
This fixes a bug that causes the video XBlock parsing to break in the new XBlock runtime if:
* the html5_sources field is set, and
* the download_video field is not set
The error is:
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/rest_api/views.py", line 52, in render_block_view
block = load_block(usage_key, request.user)
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/api.py", line 84, in load_block
return runtime.get_block(usage_key)
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/runtime/blockstore_runtime.py", line 70, in get_block
block = block_class.parse_xml_new_runtime(xml_node, runtime=self, keys=keys)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/video_module/video_module.py", line 620, in parse_xml_new_runtime
setattr(video_block, key, cls.fields[key].from_json(val))
KeyError: 'source'
The reason for the error is that parse_video_xml() will sometimes return a 'source' attribute in its field_data return value, even though source is not a video field (anymore). This then causes an error when trying to look up cls.fields['source']
A workaround in the meantime is to add download_video="false" to the OLX.