File tree Expand file tree Collapse file tree
openedx/core/djangoapps/common_initialization Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22Common initialization app for the LMS and CMS
33"""
44
5-
65from django .apps import AppConfig
76from django .db import connection
87
@@ -31,14 +30,15 @@ def _add_mimetypes():
3130
3231 @staticmethod
3332 def _add_required_adapters ():
33+ """
34+ Register CourseLocator in psycopg2 extensions
35+ :return:
36+ """
3437 if 'postgresql' in connection .vendor .lower ():
3538 from opaque_keys .edx .locator import CourseLocator
36- from psycopg2 .extensions import register_adapter , QuotedString
37-
38-
39+ from psycopg2 .extensions import QuotedString , register_adapter
3940 def adapt_course_locator (course_locator ):
40- return QuotedString (course_locator ._to_string ())
41-
41+ return QuotedString (course_locator ._to_string ()) # lint-amnesty, pylint: disable=protected-access
4242
4343 # Register the adapter
4444 register_adapter (CourseLocator , adapt_course_locator )
You can’t perform that action at this time.
0 commit comments