From 035bd6ae2d23db3176d244deec1cc8f0d4539ecf Mon Sep 17 00:00:00 2001 From: Jansen Kantor Date: Thu, 23 Mar 2023 14:42:52 -0400 Subject: [PATCH] fix: allow iframe embed v2 (#31983) --- lms/djangoapps/courseware/views/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index 1dd7c8bad1..fd2e1f6c8a 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -1774,6 +1774,9 @@ class BasePublicVideoXBlockView(View): return course, video_block +@method_decorator(ensure_valid_usage_key, name='dispatch') +@method_decorator(xframe_options_exempt, name='dispatch') +@method_decorator(transaction.non_atomic_requests, name='dispatch') class PublicVideoXBlockView(BasePublicVideoXBlockView): """ View for displaying public videos """ @@ -1794,6 +1797,7 @@ class PublicVideoXBlockView(BasePublicVideoXBlockView): 'social_sharing_metadata': social_sharing_metadata, 'learn_more_url': course_about_page_url, 'enroll_url': enroll_url, + 'allow_iframing': True, 'disable_window_wrap': True, 'disable_register_button': True, 'edx_notes_enabled': False, @@ -1880,6 +1884,9 @@ class PublicVideoXBlockView(BasePublicVideoXBlockView): )) +@method_decorator(ensure_valid_usage_key, name='dispatch') +@method_decorator(xframe_options_exempt, name='dispatch') +@method_decorator(transaction.non_atomic_requests, name='dispatch') class PublicVideoXBlockEmbedView(BasePublicVideoXBlockView): """ View for viewing public videos embedded within Twitter or other social media """ def get_template_and_context(self, course, video_block):