pylint amnesty in openedx (#26341)
This commit is contained in:
@@ -1 +1 @@
|
||||
""" Thin Client for the Ecommerce API Service """
|
||||
""" Thin Client for the Ecommerce API Service """ # lint-amnesty, pylint: disable=django-not-configured
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
"""
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user