Skip to content

Commit

Permalink
fix: jump_to url not working for tutor (#35805)
Browse files Browse the repository at this point in the history
* fix: jump_to url not working for tutor

* fix: failing test and pylint
  • Loading branch information
KristinAoki authored Nov 7, 2024
1 parent 642dae6 commit ac365d8
Showing 1 changed file with 5 additions and 10 deletions.
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

0 comments on commit ac365d8

Please sign in to comment.