-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [AXIMST-410] add possibility to fetch draft item #2497
Conversation
eae2828
to
3fdcce7
Compare
@@ -1536,6 +1536,7 @@ def render_xblock(request, usage_key_string, check_if_enrolled=True, disable_sta | |||
set_custom_attribute('block_type', usage_key.block_type) | |||
|
|||
requested_view = request.GET.get('view', 'student_view') | |||
allow_render_for_mfe = request.GET.get('allow_render_for_mfe') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow_render_for_mfe = request.GET.get('allow_render_for_mfe') | |
is_authoring_mfe = request.GET.get('is_authoring_mfe') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[important] If we change it, we need to change this parameter in the MFE's PR https://github.com/raccoongang/frontend-app-course-authoring/pull/121/files#diff-0ea77001e3e5cb127775d6ab3ba0df11655fc4060abfcc302f89300ebe62e8f5R10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change as suggested by Vlad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to is_authoring_mfe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added corresponding changes to MFE raccoongang/frontend-app-course-authoring#151
0ba89ce
to
f15754b
Compare
659eb2b
to
9c2b75a
Compare
9c2b75a
to
e579a92
Compare
# No request provided, cannot proceed | ||
raise Http404 from exc | ||
|
||
referer = request.META.get('HTTP_REFERER') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach eventually not working on the dev server
HTTP_REFERER header doesn't contain /course-authoring
path in it, only domain
request.META content from debug log:
2024-02-07 13:15:25,286 ERROR 402008 [lms.djangoapps.courseware.block_render] [user 19] [ip 143.244.46.119] block_render.py:837 - ++++++<WSGIRequest: GET '/xblock/block-v1:eDx+567657+2024+type@html+block@1ba5aef177a547b983c2e3fdede6c395?show_title=0&show_bookmark=0&recheck_access=1&view=student_view&is_authoring_mfe=1'>+++++
2024-02-07 13:15:25,288 ERROR 402008 [lms.djangoapps.courseware.block_render] [user 19] [ip 143.244.46.119] block_render.py:838 - ++++++{'wsgi.errors': <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f8e056e1b80>, 'wsgi.version': (1, 0), 'wsgi.multithread': False, 'wsgi.multiprocess': True, 'wsgi.run_once': False, 'wsgi.file_wrapper': <class 'gunicorn.http.wsgi.FileWrapper'>, 'wsgi.input_terminated': True, 'SERVER_SOFTWARE': 'gunicorn/21.2.0', 'wsgi.input': <gunicorn.http.body.Body object at 0x7f8e056c0b20>, 'gunicorn.socket': <socket.socket fd=20, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 8000), raddr=('127.0.0.1', 21968)>, 'REQUEST_METHOD': 'GET', 'QUERY_STRING': 'show_title=0&show_bookmark=0&recheck_access=1&view=student_view&is_authoring_mfe=1', 'RAW_URI': '/xblock/block-v1:eDx+567657+2024+type@html+block@1ba5aef177a547b983c2e3fdede6c395?show_title=0&show_bookmark=0&recheck_access=1&view=student_view&is_authoring_mfe=1', 'SERVER_PROTOCOL': 'HTTP/1.0', 'HTTP_X_FORWARDED_PROTO': 'https', 'HTTP_X_FORWARDED_PORT': '443', 'HTTP_X_FORWARDED_FOR': '143.244.46.119', 'HTTP_X_QUEUE_START': 't=1707311724.863', 'HTTP_HOST': 'lms-studio-mfe-dev.raccoongang.com', 'HTTP_CONNECTION': 'close', 'HTTP_X_REQUEST_ID': '56356f8e77b6ea1ab2a81587c49666b3', 'HTTP_X_REAL_IP': '143.244.46.119', 'HTTP_X_FORWARDED_HOST': 'lms-studio-mfe-dev.raccoongang.com', 'HTTP_X_FORWARDED_SCHEME': 'https', 'HTTP_X_SCHEME': 'https', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0) Gecko/20100101 Firefox/124.0', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8', 'HTTP_ACCEPT_LANGUAGE': 'en;q=1.0, en;q=1.0', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br', 'HTTP_REFERER': 'https://app-studio-mfe-dev.raccoongang.com/', 'HTTP_UPGRADE_INSECURE_REQUESTS': '1', 'HTTP_SEC_FETCH_DEST': 'iframe', 'HTTP_SEC_FETCH_MODE': 'navigate', 'HTTP_SEC_FETCH_SITE': 'same-site', 'HTTP_PRAGMA': 'no-cache', 'HTTP_CACHE_CONTROL': 'no-cache', 'HTTP_COOKIE': 'openedx-language-preference=en; _ga_test=GS1.1.1706185997.45.0.1706185998.0.0.0; _ga=GA1.1.773444425.1698787115;
...
AXIMST-410