From ad5ed57160572e99fb5cb3ce9d73a6071338eca9 Mon Sep 17 00:00:00 2001 From: Nimisha Asthagiri Date: Thu, 30 Aug 2018 15:45:57 -0400 Subject: [PATCH] Revert Quality fixes --- lms/djangoapps/ccx/tests/test_field_override_performance.py | 2 +- lms/djangoapps/courseware/course_tools.py | 2 +- openedx/core/djangoapps/credit/models.py | 2 +- openedx/core/djangoapps/request_cache/middleware.py | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/ccx/tests/test_field_override_performance.py b/lms/djangoapps/ccx/tests/test_field_override_performance.py index c76dfebfce..f40192b1d0 100644 --- a/lms/djangoapps/ccx/tests/test_field_override_performance.py +++ b/lms/djangoapps/ccx/tests/test_field_override_performance.py @@ -19,9 +19,9 @@ from django.test.utils import override_settings from lms.djangoapps.ccx.tests.factories import CcxFactory from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache +from openedx.core.djangoapps.request_cache.middleware import RequestCache from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES from pytz import UTC -from openedx.core.djangoapps.request_cache.middleware import RequestCache from student.models import CourseEnrollment from student.tests.factories import UserFactory from xblock.core import XBlock diff --git a/lms/djangoapps/courseware/course_tools.py b/lms/djangoapps/courseware/course_tools.py index 25747b374a..5be900f92f 100644 --- a/lms/djangoapps/courseware/course_tools.py +++ b/lms/djangoapps/courseware/course_tools.py @@ -7,10 +7,10 @@ import pytz from django.utils.translation import ugettext as _ from course_modes.models import CourseMode +from openedx.core.djangoapps.request_cache import get_request from openedx.features.course_experience.course_tools import CourseTool from student.models import CourseEnrollment from courseware.date_summary import verified_upgrade_deadline_link -from openedx.core.djangoapps.request_cache import get_request class VerifiedUpgradeTool(CourseTool): diff --git a/openedx/core/djangoapps/credit/models.py b/openedx/core/djangoapps/credit/models.py index 962efcf6aa..a9bd61fa5b 100644 --- a/openedx/core/djangoapps/credit/models.py +++ b/openedx/core/djangoapps/credit/models.py @@ -24,7 +24,7 @@ from model_utils.models import TimeStampedModel from opaque_keys.edx.django.models import CourseKeyField from openedx.core.djangoapps.request_cache.middleware import RequestCache, ns_request_cached -from student.models import get_retired_username_by_username + CREDIT_PROVIDER_ID_REGEX = r"[a-z,A-Z,0-9,\-]+" log = logging.getLogger(__name__) diff --git a/openedx/core/djangoapps/request_cache/middleware.py b/openedx/core/djangoapps/request_cache/middleware.py index 525fb36f66..340b33a5ca 100644 --- a/openedx/core/djangoapps/request_cache/middleware.py +++ b/openedx/core/djangoapps/request_cache/middleware.py @@ -2,6 +2,7 @@ An implementation of a RequestCache. This cache is reset at the beginning and end of every request. """ +# pylint: disable=unused-argument import threading import crum @@ -21,6 +22,9 @@ REQUEST_CACHE = _RequestCache() class RequestCache(object): + """ + DEPRECATED Request Cache Middleware. Will be removed very shortly. + """ @classmethod def get_request_cache(cls, name=None): """ @@ -56,7 +60,7 @@ class RequestCache(object): self.clear_request_cache() return response - def process_exception(self, request, exception): # pylint: disable=unused-argument + def process_exception(self, request, exception): """ Clear the RequestCache after a failed request. """