From 68bb83e7272439e4e89794f616e84b2bfb1d7110 Mon Sep 17 00:00:00 2001 From: "M. Zulqarnain" Date: Wed, 3 Feb 2021 14:56:09 +0500 Subject: [PATCH] pylint amnesty in openedx (#26341) --- openedx/core/djangoapps/commerce/__init__.py | 2 +- openedx/core/djangoapps/common_initialization/apps.py | 4 ++-- openedx/core/djangoapps/common_initialization/checks.py | 4 ++-- openedx/core/djangoapps/common_views/xblock.py | 4 ++-- openedx/core/djangoapps/config_model_utils/admin.py | 4 ++-- openedx/core/djangoapps/config_model_utils/models.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openedx/core/djangoapps/commerce/__init__.py b/openedx/core/djangoapps/commerce/__init__.py index 9b06dc24a3..977fb12ffc 100644 --- a/openedx/core/djangoapps/commerce/__init__.py +++ b/openedx/core/djangoapps/commerce/__init__.py @@ -1 +1 @@ -""" Thin Client for the Ecommerce API Service """ +""" Thin Client for the Ecommerce API Service """ # lint-amnesty, pylint: disable=django-not-configured diff --git a/openedx/core/djangoapps/common_initialization/apps.py b/openedx/core/djangoapps/common_initialization/apps.py index 75cf1679cc..ccbe6d76d9 100644 --- a/openedx/core/djangoapps/common_initialization/apps.py +++ b/openedx/core/djangoapps/common_initialization/apps.py @@ -6,13 +6,13 @@ Common initialization app for the LMS and CMS from django.apps import AppConfig -class CommonInitializationConfig(AppConfig): +class CommonInitializationConfig(AppConfig): # lint-amnesty, pylint: disable=missing-class-docstring name = 'openedx.core.djangoapps.common_initialization' verbose_name = 'Common Initialization' def ready(self): # Common settings validations for the LMS and CMS. - from . import checks + from . import checks # lint-amnesty, pylint: disable=unused-import self._add_mimetypes() @staticmethod diff --git a/openedx/core/djangoapps/common_initialization/checks.py b/openedx/core/djangoapps/common_initialization/checks.py index 99fbd55d7f..f081691759 100644 --- a/openedx/core/djangoapps/common_initialization/checks.py +++ b/openedx/core/djangoapps/common_initialization/checks.py @@ -12,7 +12,7 @@ from django.core.checks import Error, Tags, register @register(Tags.compatibility) -def validate_lms_root_url_setting(app_configs, **kwargs): +def validate_lms_root_url_setting(app_configs, **kwargs): # lint-amnesty, pylint: disable=unused-argument """ Validates the LMS_ROOT_URL setting. """ @@ -28,7 +28,7 @@ def validate_lms_root_url_setting(app_configs, **kwargs): @register(Tags.compatibility) -def validate_marketing_site_setting(app_configs, **kwargs): +def validate_marketing_site_setting(app_configs, **kwargs): # lint-amnesty, pylint: disable=unused-argument """ Validates marketing site related settings. """ diff --git a/openedx/core/djangoapps/common_views/xblock.py b/openedx/core/djangoapps/common_views/xblock.py index a3a1d32e8e..33b31d4dfc 100644 --- a/openedx/core/djangoapps/common_views/xblock.py +++ b/openedx/core/djangoapps/common_views/xblock.py @@ -24,10 +24,10 @@ def xblock_resource(request, block_type, uri): # pylint: disable=unused-argumen content = xblock_class.open_local_resource(uri) except IOError: log.info('Failed to load xblock resource', exc_info=True) - raise Http404 + raise Http404 # lint-amnesty, pylint: disable=raise-missing-from except Exception: log.error('Failed to load xblock resource', exc_info=True) - raise Http404 + raise Http404 # lint-amnesty, pylint: disable=raise-missing-from mimetype, _ = mimetypes.guess_type(uri) return HttpResponse(content, content_type=mimetype) diff --git a/openedx/core/djangoapps/config_model_utils/admin.py b/openedx/core/djangoapps/config_model_utils/admin.py index e6a9891b08..6001deb3a6 100644 --- a/openedx/core/djangoapps/config_model_utils/admin.py +++ b/openedx/core/djangoapps/config_model_utils/admin.py @@ -14,7 +14,7 @@ class CourseOverviewField(forms.ModelChoiceField): def to_python(self, value): if value in self.empty_values: return None - return super(CourseOverviewField, self).to_python(CourseKey.from_string(value)) + return super(CourseOverviewField, self).to_python(CourseKey.from_string(value)) # lint-amnesty, pylint: disable=super-with-arguments class StackedConfigModelAdminForm(forms.ModelForm): @@ -77,6 +77,6 @@ class StackedConfigModelAdmin(ConfigurationModelAdmin): """ Return all field names, excluding reverse foreign key relationships. """ - names = super(StackedConfigModelAdmin, self).get_displayable_field_names() + names = super(StackedConfigModelAdmin, self).get_displayable_field_names() # lint-amnesty, pylint: disable=super-with-arguments fixed_names = ['id', 'change_date', 'changed_by'] + list(self.model.KEY_FIELDS) return fixed_names + [name for name in names if name not in fixed_names] diff --git a/openedx/core/djangoapps/config_model_utils/models.py b/openedx/core/djangoapps/config_model_utils/models.py index 466baddf03..f9eeef6afe 100644 --- a/openedx/core/djangoapps/config_model_utils/models.py +++ b/openedx/core/djangoapps/config_model_utils/models.py @@ -326,7 +326,7 @@ class StackedConfigurationModel(ConfigurationModel): @classmethod @request_cached() - def _site_from_org(cls, org): + def _site_from_org(cls, org): # lint-amnesty, pylint: disable=missing-function-docstring configuration = SiteConfiguration.get_configuration_for_org(org, select_related=['site']) if configuration is None: