Skip to content

Commit

Permalink
fix: quality issues
Browse files Browse the repository at this point in the history
  • Loading branch information
qasimgulzar authored and qasimgulzar committed Nov 22, 2024
1 parent 5b3c21c commit 5bd2d5a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions openedx/core/djangoapps/common_initialization/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Common initialization app for the LMS and CMS
"""


from django.apps import AppConfig
from django.db import connection

Expand Down Expand Up @@ -31,14 +30,15 @@ def _add_mimetypes():

@staticmethod
def _add_required_adapters():
"""
Register CourseLocator in psycopg2 extensions
:return:
"""
if 'postgresql' in connection.vendor.lower():
from opaque_keys.edx.locator import CourseLocator
from psycopg2.extensions import register_adapter, QuotedString


from psycopg2.extensions import QuotedString, register_adapter
def adapt_course_locator(course_locator):
return QuotedString(course_locator._to_string())

return QuotedString(course_locator._to_string()) # lint-amnesty, pylint: disable=protected-access

# Register the adapter
register_adapter(CourseLocator, adapt_course_locator)

0 comments on commit 5bd2d5a

Please sign in to comment.