diff --git a/openedx/core/djangoapps/common_initialization/apps.py b/openedx/core/djangoapps/common_initialization/apps.py index f6977c68897e..36dc8375309b 100644 --- a/openedx/core/djangoapps/common_initialization/apps.py +++ b/openedx/core/djangoapps/common_initialization/apps.py @@ -37,7 +37,9 @@ def _add_required_adapters(): if 'postgresql' in connection.vendor.lower(): from opaque_keys.edx.locator import CourseLocator from psycopg2.extensions import QuotedString, register_adapter + def adapt_course_locator(course_locator): + return QuotedString(course_locator._to_string()) # lint-amnesty, pylint: disable=protected-access # Register the adapter