Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TypeError due to None LEARNING_MICROFRONTEND_URL setting value
We observed the following error in production: lms_1 | 2020-06-22 14:03:10,220 ERROR 10 [django.request] [user 4] log.py:228 - Internal Server Error: /xblock/block-v1:edX+DemoX+Demo_Course+type@html+block@6bcccc2d7343416e9e03 fd7325b2f232 lms_1 | Traceback (most recent call last): lms_1 | File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner lms_1 | response = get_response(request) lms_1 | File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 115, in _get_response lms_1 | response = self.process_exception_by_middleware(e, request) lms_1 | File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 113, in _get_response lms_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs) lms_1 | File "/openedx/venv/lib/python3.5/site-packages/django/views/decorators/http.py", line 40, in inner lms_1 | return func(request, *args, **kwargs) lms_1 | File "/openedx/edx-platform/common/djangoapps/util/views.py", line 66, in inner lms_1 | response = view_func(request, *args, **kwargs) lms_1 | File "/openedx/venv/lib/python3.5/site-packages/django/views/decorators/clickjacking.py", line 50, in wrapped_view lms_1 | resp = view_func(*args, **kwargs) lms_1 | File "/openedx/venv/lib/python3.5/site-packages/django/utils/decorators.py", line 142, in _wrapped_view lms_1 | response = view_func(request, *args, **kwargs) lms_1 | File "/openedx/edx-platform/lms/djangoapps/courseware/views/views.py", line 1683, in render_xblock lms_1 | 'is_learning_mfe': request.META.get('HTTP_REFERER', '').startswith(settings.LEARNING_MICROFRONTEND_URL), lms_1 | TypeError: startswith first arg must be str or a tuple of str, not NoneType
- Loading branch information