Skip to content
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

fix: jump_to url not working for tutor #35805

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions openedx/features/course_experience/url_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.http.request import QueryDict
from django.urls import reverse
from opaque_keys.edx.keys import CourseKey, UsageKey
from six.moves.urllib.parse import urlencode, urlparse, urlunparse
from six.moves.urllib.parse import urlencode, urlparse

from lms.djangoapps.courseware.toggles import courseware_mfe_is_active
from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order
Expand Down Expand Up @@ -171,9 +171,8 @@ def make_learning_mfe_courseware_url(
strings. They're only ever used to concatenate a URL string.
`params` is an optional QueryDict object (e.g. request.GET)
"""
mfe_link = f'/course/{course_key}'
mfe_link = f'{settings.LEARNING_MICROFRONTEND_URL}/course/{course_key}'
get_params = params.copy() if params else None
query_string = ''

if preview:
if len(get_params.keys()) > 1:
Expand All @@ -182,7 +181,7 @@ def make_learning_mfe_courseware_url(
get_params = None

if (unit_key or sequence_key):
mfe_link = f'/preview/course/{course_key}'
mfe_link = f'{settings.LEARNING_MICROFRONTEND_URL}/preview/course/{course_key}'

if sequence_key:
mfe_link += f'/{sequence_key}'
Expand All @@ -191,13 +190,9 @@ def make_learning_mfe_courseware_url(
mfe_link += f'/{unit_key}'

if get_params:
query_string = get_params.urlencode()

url_parts = list(urlparse(settings.LEARNING_MICROFRONTEND_URL))
url_parts[2] = mfe_link
url_parts[4] = query_string
mfe_link += f'?{get_params.urlencode()}'

return urlunparse(url_parts)
return mfe_link


def get_learning_mfe_home_url(
Expand Down
Loading