diff --git a/openedx/core/djangoapps/django_comment_common/comment_client/settings.py b/openedx/core/djangoapps/django_comment_common/comment_client/settings.py index 6317dbc79853..4e93ceec354d 100644 --- a/openedx/core/djangoapps/django_comment_common/comment_client/settings.py +++ b/openedx/core/djangoapps/django_comment_common/comment_client/settings.py @@ -14,4 +14,4 @@ else: SERVICE_HOST_V2 = 'http://localhost:8000' -PREFIX_V2 = SERVICE_HOST_V2 + '/api/v1' +PREFIX_V2 = SERVICE_HOST_V2 + '/forum/forum_proxy/api/v1' diff --git a/openedx/core/djangoapps/django_comment_common/comment_client/utils.py b/openedx/core/djangoapps/django_comment_common/comment_client/utils.py index 585e80264e14..92a647bdc15c 100644 --- a/openedx/core/djangoapps/django_comment_common/comment_client/utils.py +++ b/openedx/core/djangoapps/django_comment_common/comment_client/utils.py @@ -75,7 +75,7 @@ def perform_request(method, url, data_or_params=None, raw=False, timeout=config.connection_timeout ) - if method == 'get': + if method == "get": forum_v2_url = _get_forum_v2_url(url) response_v2 = requests.request( method, @@ -83,11 +83,15 @@ def perform_request(method, url, data_or_params=None, raw=False, data=data, params=params, headers=headers, - timeout=config.connection_timeout + timeout=config.connection_timeout, ) - if response_v2 != response: - log.error(f"Forum v2 diff for endpoint {url} with params={params}. \ - Expected: {response}. Got: {response_v2}.") + log.info(f"requested forum v1 url: {url}") + log.info(f"requested forum v2 url: {forum_v2_url}") + if response_v2.json() != response.json(): + log.error( + f"Forum v2 difference, for endpoint {url} with params={params}. \ + Expected: {response.json()}. Got: {response_v2.json()}." + ) metric_tags.append(f'status_code:{response.status_code}') status_code = int(response.status_code)