diff --git a/lms/djangoapps/ccx/api/v0/paginators.py b/lms/djangoapps/ccx/api/v0/paginators.py index 17ddb56a1a..241d510cc4 100644 --- a/lms/djangoapps/ccx/api/v0/paginators.py +++ b/lms/djangoapps/ccx/api/v0/paginators.py @@ -14,7 +14,7 @@ class CCXAPIPagination(DefaultPagination): """ Annotate the response with pagination information. """ - response = super(CCXAPIPagination, self).get_paginated_response(data) + response = super(CCXAPIPagination, self).get_paginated_response(data) # lint-amnesty, pylint: disable=super-with-arguments # Add the current page to the response. response.data["current_page"] = self.page.number diff --git a/lms/djangoapps/ccx/api/v0/tests/test_views.py b/lms/djangoapps/ccx/api/v0/tests/test_views.py index b11bb2f950..4bd2baca23 100644 --- a/lms/djangoapps/ccx/api/v0/tests/test_views.py +++ b/lms/djangoapps/ccx/api/v0/tests/test_views.py @@ -13,7 +13,7 @@ import mock import six from ccx_keys.locator import CCXLocator from django.conf import settings -from django.contrib.auth.models import User +from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.urls import Resolver404, resolve, reverse from django.utils.timezone import now from oauth2_provider import models as dot_models @@ -49,7 +49,7 @@ class CcxRestApiTest(CcxTestCase, APITestCase): """ Set up tests """ - super(CcxRestApiTest, self).setUp() + super(CcxRestApiTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # add some info about the course for easy access self.master_course_key = self.course.location.course_key self.master_course_key_str = six.text_type(self.master_course_key) @@ -138,7 +138,7 @@ class CcxListTest(CcxRestApiTest): """ Set up tests """ - super(CcxListTest, self).setUp() + super(CcxListTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.list_url = reverse('ccx_api:v0:ccx:list') self.list_url_master_course = six.moves.urllib.parse.urljoin( self.list_url, @@ -696,7 +696,7 @@ class CcxDetailTest(CcxRestApiTest): """ Set up tests """ - super(CcxDetailTest, self).setUp() + super(CcxDetailTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.make_coach() # create a ccx self.ccx = self.make_ccx(max_students_allowed=123) @@ -709,7 +709,7 @@ class CcxDetailTest(CcxRestApiTest): Overridden method to replicate (part of) the actual creation of ccx courses """ - ccx = super(CcxDetailTest, self).make_ccx(max_students_allowed=max_students_allowed) + ccx = super(CcxDetailTest, self).make_ccx(max_students_allowed=max_students_allowed) # lint-amnesty, pylint: disable=super-with-arguments ccx.structure_json = json.dumps(self.master_course_chapters) ccx.save() diff --git a/lms/djangoapps/ccx/api/v0/views.py b/lms/djangoapps/ccx/api/v0/views.py index 4ceadc74a3..94b93c007c 100644 --- a/lms/djangoapps/ccx/api/v0/views.py +++ b/lms/djangoapps/ccx/api/v0/views.py @@ -8,7 +8,7 @@ import logging import pytz import six from ccx_keys.locator import CCXLocator -from django.contrib.auth.models import User +from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.db import transaction from django.http import Http404 from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication diff --git a/lms/djangoapps/ccx/custom_exception.py b/lms/djangoapps/ccx/custom_exception.py index c1855c378d..c18b227484 100644 --- a/lms/djangoapps/ccx/custom_exception.py +++ b/lms/djangoapps/ccx/custom_exception.py @@ -7,11 +7,11 @@ class CCXUserValidationException(Exception): """ Custom Exception for validation of users in CCX """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class CCXLocatorValidationException(Exception): """ Custom Exception to validate CCX locator """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass diff --git a/lms/djangoapps/ccx/models.py b/lms/djangoapps/ccx/models.py index 534f66512f..e28ffda007 100644 --- a/lms/djangoapps/ccx/models.py +++ b/lms/djangoapps/ccx/models.py @@ -9,7 +9,7 @@ from datetime import datetime import six from ccx_keys.locator import CCXLocator -from django.contrib.auth.models import User +from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.db import models from lazy import lazy from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField diff --git a/lms/djangoapps/ccx/modulestore.py b/lms/djangoapps/ccx/modulestore.py index 3fbfbbd754..2d9983abfb 100644 --- a/lms/djangoapps/ccx/modulestore.py +++ b/lms/djangoapps/ccx/modulestore.py @@ -114,7 +114,7 @@ class CCXModulestoreWrapper(object): def _clean_locator_for_mapping(self, locator): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(locator) as (locator, restore): + with remove_ccx(locator) as (locator, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local # pylint: disable=protected-access return restore( self._modulestore._clean_locator_for_mapping(locator) @@ -129,7 +129,7 @@ class CCXModulestoreWrapper(object): def fill_in_run(self, course_key): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_key) as (course_key, restore): + with remove_ccx(course_key) as (course_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.fill_in_run(course_key)) def has_item(self, usage_key, **kwargs): @@ -139,26 +139,26 @@ class CCXModulestoreWrapper(object): def get_item(self, usage_key, depth=0, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(usage_key) as (usage_key, restore): + with remove_ccx(usage_key) as (usage_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore( self._modulestore.get_item(usage_key, depth, **kwargs) ) def get_items(self, course_key, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_key) as (course_key, restore): + with remove_ccx(course_key) as (course_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.get_items(course_key, **kwargs)) def get_course(self, course_key, depth=0, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_key) as (course_key, restore): + with remove_ccx(course_key) as (course_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.get_course( course_key, depth=depth, **kwargs )) def has_course(self, course_id, ignore_case=False, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_id) as (course_id, restore): + with remove_ccx(course_id) as (course_id, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.has_course( course_id, ignore_case=ignore_case, **kwargs )) @@ -172,120 +172,120 @@ class CCXModulestoreWrapper(object): def get_parent_location(self, location, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(location) as (location, restore): + with remove_ccx(location) as (location, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore( self._modulestore.get_parent_location(location, **kwargs) ) def get_block_original_usage(self, usage_key): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(usage_key) as (usage_key, restore): + with remove_ccx(usage_key) as (usage_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local orig_key, version = self._modulestore.get_block_original_usage(usage_key) return restore(orig_key), version def get_modulestore_type(self, course_id): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_id) as (course_id, restore): + with remove_ccx(course_id) as (course_id, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.get_modulestore_type(course_id)) def get_orphans(self, course_key, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_key) as (course_key, restore): + with remove_ccx(course_key) as (course_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.get_orphans(course_key, **kwargs)) def clone_course(self, source_course_id, dest_course_id, user_id, fields=None, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(source_course_id) as (source_course_id, _): - with remove_ccx(dest_course_id) as (dest_course_id, dest_restore): + with remove_ccx(source_course_id) as (source_course_id, _): # lint-amnesty, pylint: disable=redefined-argument-from-local + with remove_ccx(dest_course_id) as (dest_course_id, dest_restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return dest_restore(self._modulestore.clone_course( source_course_id, dest_course_id, user_id, fields=fields, **kwargs )) def create_item(self, user_id, course_key, block_type, block_id=None, fields=None, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_key) as (course_key, restore): + with remove_ccx(course_key) as (course_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.create_item( user_id, course_key, block_type, block_id=block_id, fields=fields, **kwargs )) def create_child(self, user_id, parent_usage_key, block_type, block_id=None, fields=None, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(parent_usage_key) as (parent_usage_key, restore): + with remove_ccx(parent_usage_key) as (parent_usage_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.create_child( user_id, parent_usage_key, block_type, block_id=block_id, fields=fields, **kwargs )) def import_xblock(self, user_id, course_key, block_type, block_id, fields=None, runtime=None, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_key) as (course_key, restore): + with remove_ccx(course_key) as (course_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.import_xblock( user_id, course_key, block_type, block_id, fields=fields, runtime=runtime, **kwargs )) def copy_from_template(self, source_keys, dest_key, user_id, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(dest_key) as (dest_key, restore): + with remove_ccx(dest_key) as (dest_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.copy_from_template( source_keys, dest_key, user_id, **kwargs )) def update_item(self, xblock, user_id, allow_not_found=False, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(xblock) as (xblock, restore): + with remove_ccx(xblock) as (xblock, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.update_item( xblock, user_id, allow_not_found=allow_not_found, **kwargs )) def delete_item(self, location, user_id, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(location) as (location, restore): + with remove_ccx(location) as (location, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore( self._modulestore.delete_item(location, user_id, **kwargs) ) def revert_to_published(self, location, user_id): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(location) as (location, restore): + with remove_ccx(location) as (location, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore( self._modulestore.revert_to_published(location, user_id) ) def create_xblock(self, runtime, course_key, block_type, block_id=None, fields=None, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(course_key) as (course_key, restore): + with remove_ccx(course_key) as (course_key, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.create_xblock( runtime, course_key, block_type, block_id=block_id, fields=fields, **kwargs )) def has_published_version(self, xblock): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(xblock) as (xblock, restore): + with remove_ccx(xblock) as (xblock, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.has_published_version(xblock)) def publish(self, location, user_id, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(location) as (location, restore): + with remove_ccx(location) as (location, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore( self._modulestore.publish(location, user_id, **kwargs) ) def unpublish(self, location, user_id, **kwargs): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(location) as (location, restore): + with remove_ccx(location) as (location, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore( self._modulestore.unpublish(location, user_id, **kwargs) ) def convert_to_draft(self, location, user_id): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(location) as (location, restore): + with remove_ccx(location) as (location, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore( self._modulestore.convert_to_draft(location, user_id) ) def has_changes(self, xblock): """See the docs for xmodule.modulestore.mixed.MixedModuleStore""" - with remove_ccx(xblock) as (xblock, restore): + with remove_ccx(xblock) as (xblock, restore): # lint-amnesty, pylint: disable=redefined-argument-from-local return restore(self._modulestore.has_changes(xblock)) def check_supports(self, course_key, method): diff --git a/lms/djangoapps/ccx/overrides.py b/lms/djangoapps/ccx/overrides.py index a2e4b94c3f..8f86150e0c 100644 --- a/lms/djangoapps/ccx/overrides.py +++ b/lms/djangoapps/ccx/overrides.py @@ -49,7 +49,7 @@ class CustomCoursesForEdxOverrideProvider(FieldOverrideProvider): return default @classmethod - def enabled_for(cls, block): + def enabled_for(cls, block): # lint-amnesty, pylint: disable=arguments-differ """ CCX field overrides are enabled for CCX blocks. """ diff --git a/lms/djangoapps/ccx/tests/test_ccx_modulestore.py b/lms/djangoapps/ccx/tests/test_ccx_modulestore.py index 518e8d6f49..59c4c2306b 100644 --- a/lms/djangoapps/ccx/tests/test_ccx_modulestore.py +++ b/lms/djangoapps/ccx/tests/test_ccx_modulestore.py @@ -45,7 +45,7 @@ class TestCCXModulestoreWrapper(SharedModuleStoreTestCase): ] @classmethod - def setUpTestData(cls): + def setUpTestData(cls): # lint-amnesty, pylint: disable=super-method-not-called """ Set up models for the whole TestCase. """ @@ -57,7 +57,7 @@ class TestCCXModulestoreWrapper(SharedModuleStoreTestCase): """ Set up tests """ - super(TestCCXModulestoreWrapper, self).setUp() + super(TestCCXModulestoreWrapper, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.ccx = ccx = CustomCourseForEdX( course_id=self.course.id, display_name='Test CCX', diff --git a/lms/djangoapps/ccx/tests/test_field_override_performance.py b/lms/djangoapps/ccx/tests/test_field_override_performance.py index 6bc24aa90e..6b1aa223b9 100644 --- a/lms/djangoapps/ccx/tests/test_field_override_performance.py +++ b/lms/djangoapps/ccx/tests/test_field_override_performance.py @@ -58,7 +58,7 @@ class FieldOverridePerformanceTestCase(FieldOverrideTestMixin, ProceduralCourseT """ __test__ = False # Tell Django to clean out all databases, not just default - databases = {alias for alias in connections} + databases = {alias for alias in connections} # lint-amnesty, pylint: disable=unnecessary-comprehension # TEST_DATA must be overridden by subclasses TEST_DATA = None @@ -67,7 +67,7 @@ class FieldOverridePerformanceTestCase(FieldOverrideTestMixin, ProceduralCourseT """ Create a test client, course, and user. """ - super(FieldOverridePerformanceTestCase, self).setUp() + super(FieldOverridePerformanceTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.request_factory = RequestFactory() self.student = UserFactory.create() @@ -229,7 +229,7 @@ class FieldOverridePerformanceTestCase(FieldOverrideTestMixin, ProceduralCourseT XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'], MODULESTORE_FIELD_OVERRIDE_PROVIDERS=providers[overrides], ): - sql_queries, mongo_reads = self.TEST_DATA[ + sql_queries, mongo_reads = self.TEST_DATA[ # lint-amnesty, pylint: disable=unsubscriptable-object (overrides, course_width, enable_ccx, view_as_ccx) ] self.instrument_course_progress_render( diff --git a/lms/djangoapps/ccx/tests/test_models.py b/lms/djangoapps/ccx/tests/test_models.py index 66a4622252..35e8d7b1c1 100644 --- a/lms/djangoapps/ccx/tests/test_models.py +++ b/lms/djangoapps/ccx/tests/test_models.py @@ -27,7 +27,7 @@ class TestCCX(ModuleStoreTestCase): def setUp(self): """common setup for all tests""" - super(TestCCX, self).setUp() + super(TestCCX, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course = CourseFactory.create() self.coach = AdminFactory.create() role = CourseCcxCoachRole(self.course.id) diff --git a/lms/djangoapps/ccx/tests/test_overrides.py b/lms/djangoapps/ccx/tests/test_overrides.py index 98b19a9e68..147ec8804d 100644 --- a/lms/djangoapps/ccx/tests/test_overrides.py +++ b/lms/djangoapps/ccx/tests/test_overrides.py @@ -63,7 +63,7 @@ class TestFieldOverrides(FieldOverrideTestMixin, SharedModuleStoreTestCase): """ Set up tests """ - super(TestFieldOverrides, self).setUp() + super(TestFieldOverrides, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.ccx = ccx = CustomCourseForEdX( course_id=self.course.id, diff --git a/lms/djangoapps/ccx/tests/test_tasks.py b/lms/djangoapps/ccx/tests/test_tasks.py index ae468bcc0c..6d6daa50ca 100644 --- a/lms/djangoapps/ccx/tests/test_tasks.py +++ b/lms/djangoapps/ccx/tests/test_tasks.py @@ -20,7 +20,7 @@ from xmodule.modulestore.tests.factories import CourseFactory @contextlib.contextmanager -def mock_signal_receiver(signal): +def mock_signal_receiver(signal): # lint-amnesty, pylint: disable=missing-function-docstring receiver = mock.Mock() signal.connect(receiver) yield receiver @@ -39,7 +39,7 @@ class TestSendCCXCoursePublished(ModuleStoreTestCase): """ Set up tests """ - super(TestSendCCXCoursePublished, self).setUp() + super(TestSendCCXCoursePublished, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments course = self.course = CourseFactory.create(org="edX", course="999", display_name="Run 666") course2 = self.course2 = CourseFactory.create(org="edX", course="999a", display_name="Run 667") coach = AdminFactory.create() diff --git a/lms/djangoapps/ccx/tests/test_utils.py b/lms/djangoapps/ccx/tests/test_utils.py index 12ff664e5d..aee75f050d 100644 --- a/lms/djangoapps/ccx/tests/test_utils.py +++ b/lms/djangoapps/ccx/tests/test_utils.py @@ -27,7 +27,7 @@ class TestGetCCXFromCCXLocator(ModuleStoreTestCase): def setUp(self): """Set up a course, coach, ccx and user""" - super(TestGetCCXFromCCXLocator, self).setUp() + super(TestGetCCXFromCCXLocator, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course = CourseFactory.create() coach = self.coach = AdminFactory.create() role = CourseCcxCoachRole(self.course.id) @@ -60,7 +60,7 @@ class TestStaffOnCCX(CcxTestCase): MODULESTORE = TEST_DATA_SPLIT_MODULESTORE def setUp(self): - super(TestStaffOnCCX, self).setUp() + super(TestStaffOnCCX, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # Create instructor account self.client.login(username=self.coach.username, password="test") diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index cf4abb44f2..3f6cc712c8 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -132,7 +132,7 @@ class TestAdminAccessCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): MODULESTORE = TEST_DATA_SPLIT_MODULESTORE def setUp(self): - super(TestAdminAccessCoachDashboard, self).setUp() + super(TestAdminAccessCoachDashboard, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.make_coach() ccx = self.make_ccx() ccx_key = CCXLocator.from_course_locator(self.course.id, ccx.id) @@ -303,7 +303,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): """ Set up tests """ - super(TestCoachDashboard, self).setUp() + super(TestCoachDashboard, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # Login with the instructor account self.client.login(username=self.coach.username, password="test") @@ -847,7 +847,7 @@ class TestCoachDashboardSchedule(CcxTestCase, LoginEnrollmentTestCase, ModuleSto ENABLED_CACHES = ['default', 'mongo_inheritance_cache', 'loc_cache'] def setUp(self): - super(TestCoachDashboardSchedule, self).setUp() + super(TestCoachDashboardSchedule, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course = course = CourseFactory.create(enable_ccx=True) # Create a course outline @@ -1027,7 +1027,7 @@ class TestCCXGrades(FieldOverrideTestMixin, SharedModuleStoreTestCase, LoginEnro """ Set up tests """ - super(TestCCXGrades, self).setUp() + super(TestCCXGrades, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # Create instructor account self.coach = coach = AdminFactory.create() @@ -1121,7 +1121,7 @@ class TestCCXGrades(FieldOverrideTestMixin, SharedModuleStoreTestCase, LoginEnro get_course.return_value = self.course self.addCleanup(patch_context.stop) - self.client.login(username=self.student.username, password="test") + self.client.login(username=self.student.username, password="test") # lint-amnesty, pylint: disable=no-member url = reverse( 'progress', kwargs={'course_id': self.ccx_key} @@ -1146,7 +1146,7 @@ class CCXCoachTabTestCase(CcxTestCase): cls.ccx_disabled_course = CourseFactory.create(enable_ccx=False) def setUp(self): - super(CCXCoachTabTestCase, self).setUp() + super(CCXCoachTabTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.user = UserFactory.create() for course in [self.ccx_enabled_course, self.ccx_disabled_course]: CourseEnrollmentFactory.create(user=self.user, course_id=course.id) @@ -1246,7 +1246,7 @@ class TestStudentViewsWithCCX(ModuleStoreTestCase): """ Set up courses and enrollments. """ - super(TestStudentViewsWithCCX, self).setUp() + super(TestStudentViewsWithCCX, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # Create a Draft Mongo and a Split Mongo course and enroll a student user in them. self.student_password = "foobar" diff --git a/lms/djangoapps/ccx/tests/utils.py b/lms/djangoapps/ccx/tests/utils.py index b123dc82d8..50bcd016f2 100644 --- a/lms/djangoapps/ccx/tests/utils.py +++ b/lms/djangoapps/ccx/tests/utils.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=cyclic-import Test utils for CCX """ @@ -69,7 +69,7 @@ class CcxTestCase(EmailTemplateTagMixin, SharedModuleStoreTestCase): """ Set up tests """ - super(CcxTestCase, self).setUp() + super(CcxTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # Create instructor account self.coach = UserFactory.create(password="test") # create an instance of modulestore diff --git a/lms/djangoapps/ccx/utils.py b/lms/djangoapps/ccx/utils.py index 34a849ccf9..45b1e8504d 100644 --- a/lms/djangoapps/ccx/utils.py +++ b/lms/djangoapps/ccx/utils.py @@ -11,7 +11,7 @@ from contextlib import contextmanager from smtplib import SMTPException import pytz -from django.contrib.auth.models import User +from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.core.exceptions import ValidationError from django.core.validators import validate_email from django.urls import reverse @@ -226,7 +226,7 @@ def get_valid_student_with_email(identifier): try: validate_email(email) except ValidationError: - raise CCXUserValidationException(u'Could not find a user with name or email "{0}" '.format(identifier)) + raise CCXUserValidationException(u'Could not find a user with name or email "{0}" '.format(identifier)) # lint-amnesty, pylint: disable=raise-missing-from return email, user @@ -271,7 +271,7 @@ def ccx_students_enrolling_center(action, identifiers, email_students, course_ke errors.append(error) break enroll_email(course_key, email, auto_enroll=True, email_students=email_students, email_params=email_params) - elif action == 'Unenroll' or action == 'revoke': + elif action == 'Unenroll' or action == 'revoke': # lint-amnesty, pylint: disable=consider-using-in for identifier in identifiers: try: email, __ = get_valid_student_with_email(identifier) diff --git a/lms/djangoapps/ccx/views.py b/lms/djangoapps/ccx/views.py index 7b83c0f729..082c683ec8 100644 --- a/lms/djangoapps/ccx/views.py +++ b/lms/djangoapps/ccx/views.py @@ -16,7 +16,7 @@ import six from ccx_keys.locator import CCXLocator from django.conf import settings from django.contrib import messages -from django.contrib.auth.models import User +from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.db import transaction from django.http import Http404, HttpResponse, HttpResponseForbidden from django.shortcuts import redirect @@ -81,13 +81,13 @@ def coach_dashboard(view): try: ccx = CustomCourseForEdX.objects.get(pk=ccx_id) except CustomCourseForEdX.DoesNotExist: - raise Http404 + raise Http404 # lint-amnesty, pylint: disable=raise-missing-from if ccx: course_key = ccx.course_id course = get_course_by_id(course_key, depth=None) - if not course.enable_ccx: + if not course.enable_ccx: # lint-amnesty, pylint: disable=no-else-raise raise Http404 else: if bool(request.user.has_perm(VIEW_CCX_COACH_DASHBOARD, course)): @@ -152,7 +152,7 @@ def dashboard(request, course, ccx=None): context['grading_policy_url'] = reverse( 'ccx_set_grading_policy', kwargs={'course_id': ccx_locator}) - with ccx_course(ccx_locator) as course: + with ccx_course(ccx_locator) as course: # lint-amnesty, pylint: disable=redefined-argument-from-local context['course'] = course else: @@ -247,7 +247,7 @@ def create_ccx(request, course, ccx=None): @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @coach_dashboard -def save_ccx(request, course, ccx=None): +def save_ccx(request, course, ccx=None): # lint-amnesty, pylint: disable=too-many-statements """ Save changes to CCX. """ @@ -340,7 +340,7 @@ def save_ccx(request, course, ccx=None): for rec, response in responses: log.info(u'Signal fired when course is published. Receiver: %s. Response: %s', rec, response) - return HttpResponse( + return HttpResponse( # lint-amnesty, pylint: disable=http-response-with-content-type-json, http-response-with-json-dumps json.dumps({ 'schedule': get_ccx_schedule(course, ccx), 'grading_policy': json.dumps(policy, indent=4)}), @@ -455,7 +455,7 @@ def ccx_schedule(request, course, ccx=None): schedule = get_ccx_schedule(course, ccx) json_schedule = json.dumps(schedule, indent=4) - return HttpResponse(json_schedule, content_type='application/json') + return HttpResponse(json_schedule, content_type='application/json') # lint-amnesty, pylint: disable=http-response-with-content-type-json @ensure_csrf_cookie @@ -494,7 +494,7 @@ def ccx_gradebook(request, course, ccx=None): raise Http404 ccx_key = CCXLocator.from_course_locator(course.id, six.text_type(ccx.id)) - with ccx_course(ccx_key) as course: + with ccx_course(ccx_key) as course: # lint-amnesty, pylint: disable=redefined-argument-from-local student_info, page = get_grade_book_page(request, course, course_key=ccx_key) return render_to_response('courseware/gradebook.html', { @@ -521,7 +521,7 @@ def ccx_grades_csv(request, course, ccx=None): raise Http404 ccx_key = CCXLocator.from_course_locator(course.id, six.text_type(ccx.id)) - with ccx_course(ccx_key) as course: + with ccx_course(ccx_key) as course: # lint-amnesty, pylint: disable=redefined-argument-from-local enrolled_students = User.objects.filter( courseenrollment__course_id=ccx_key,