From 5bd2d5a772fbdc5ca2e8a35c020189127187ff9d Mon Sep 17 00:00:00 2001 From: qasimgulzar Date: Mon, 18 Nov 2024 16:50:16 +0500 Subject: [PATCH] fix: quality issues --- .../core/djangoapps/common_initialization/apps.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openedx/core/djangoapps/common_initialization/apps.py b/openedx/core/djangoapps/common_initialization/apps.py index 574a3f3b6154..f6977c68897e 100644 --- a/openedx/core/djangoapps/common_initialization/apps.py +++ b/openedx/core/djangoapps/common_initialization/apps.py @@ -2,7 +2,6 @@ Common initialization app for the LMS and CMS """ - from django.apps import AppConfig from django.db import connection @@ -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)