Applied pylint-amnesty to pipeline_mako
This commit is contained in:
@@ -12,7 +12,7 @@ from .models import CourseEntitlement, CourseEntitlementPolicy, CourseEntitlemen
|
||||
|
||||
|
||||
@admin.register(CourseEntitlement)
|
||||
class CourseEntitlementAdmin(admin.ModelAdmin):
|
||||
class CourseEntitlementAdmin(admin.ModelAdmin): # lint-amnesty, pylint: disable=missing-class-docstring
|
||||
list_display = ('user',
|
||||
'uuid',
|
||||
'course_uuid',
|
||||
@@ -30,13 +30,13 @@ class CourseEntitlementAdmin(admin.ModelAdmin):
|
||||
class CourseEntitlementSupportDetailForm(forms.ModelForm):
|
||||
"""Form for adding entitlement support details, exists mostly for testing purposes"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CourseEntitlementSupportDetailForm, self).__init__(*args, **kwargs)
|
||||
super(CourseEntitlementSupportDetailForm, self).__init__(*args, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments
|
||||
|
||||
if self.data.get('unenrolled_run'):
|
||||
try:
|
||||
self.data['unenrolled_run'] = CourseKey.from_string(self.data['unenrolled_run'])
|
||||
except InvalidKeyError:
|
||||
raise forms.ValidationError("No valid CourseKey for id {}!".format(self.data['unenrolled_run']))
|
||||
raise forms.ValidationError("No valid CourseKey for id {}!".format(self.data['unenrolled_run'])) # lint-amnesty, pylint: disable=raise-missing-from
|
||||
|
||||
def clean_course_id(self):
|
||||
"""Cleans course id and attempts to make course key from string version of key"""
|
||||
@@ -44,7 +44,7 @@ class CourseEntitlementSupportDetailForm(forms.ModelForm):
|
||||
try:
|
||||
course_key = CourseKey.from_string(course_id)
|
||||
except InvalidKeyError:
|
||||
raise forms.ValidationError("Cannot make a valid CourseKey from id {}!".format(course_id))
|
||||
raise forms.ValidationError("Cannot make a valid CourseKey from id {}!".format(course_id)) # lint-amnesty, pylint: disable=raise-missing-from
|
||||
|
||||
if not modulestore().has_course(course_key):
|
||||
raise forms.ValidationError("Cannot find course with id {} in the modulestore".format(course_id))
|
||||
@@ -72,7 +72,7 @@ class CourseEntitlementSupportDetailAdmin(admin.ModelAdmin):
|
||||
class CourseEntitlementPolicyForm(forms.ModelForm):
|
||||
""" Form for creating custom course entitlement policies. """
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CourseEntitlementPolicyForm, self).__init__(*args, **kwargs)
|
||||
super(CourseEntitlementPolicyForm, self).__init__(*args, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments
|
||||
self.fields['site'].required = False
|
||||
self.fields['mode'].required = False
|
||||
|
||||
|
||||
@@ -19,4 +19,4 @@ class EntitlementsConfig(AppConfig):
|
||||
Connect handlers to signals.
|
||||
"""
|
||||
from . import signals # pylint: disable=unused-import
|
||||
from .tasks import expire_old_entitlements
|
||||
from .tasks import expire_old_entitlements # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
# lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring
|
||||
|
||||
from django.conf import settings as django_settings
|
||||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
@@ -10,7 +10,7 @@ from common.djangoapps.edxmako.shortcuts import render_to_string
|
||||
from common.djangoapps.static_replace import try_staticfiles_lookup
|
||||
|
||||
|
||||
def compressed_css(package_name, raw=False):
|
||||
def compressed_css(package_name, raw=False): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
package = settings.STYLESHEETS.get(package_name, {})
|
||||
if package:
|
||||
package = {package_name: package}
|
||||
@@ -25,7 +25,7 @@ def compressed_css(package_name, raw=False):
|
||||
return render_individual_css(package, paths, raw=raw)
|
||||
|
||||
|
||||
def render_css(package, path, raw=False):
|
||||
def render_css(package, path, raw=False): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
template_name = package.template_name or "mako/css.html"
|
||||
context = package.extra_context
|
||||
|
||||
@@ -44,7 +44,7 @@ def render_individual_css(package, paths, raw=False):
|
||||
return '\n'.join(tags)
|
||||
|
||||
|
||||
def compressed_js(package_name):
|
||||
def compressed_js(package_name): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
package = settings.JAVASCRIPT.get(package_name, {})
|
||||
if package:
|
||||
package = {package_name: package}
|
||||
@@ -60,7 +60,7 @@ def compressed_js(package_name):
|
||||
return render_individual_js(package, paths, templates)
|
||||
|
||||
|
||||
def render_js(package, path):
|
||||
def render_js(package, path): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
template_name = package.template_name or "mako/js.html"
|
||||
context = package.extra_context
|
||||
context.update({
|
||||
@@ -70,7 +70,7 @@ def render_js(package, path):
|
||||
return render_to_string(template_name, context)
|
||||
|
||||
|
||||
def render_inline_js(package, js):
|
||||
def render_inline_js(package, js): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
context = package.extra_context
|
||||
context.update({
|
||||
'source': js
|
||||
|
||||
@@ -55,7 +55,7 @@ class PipelineRenderTest(TestCase):
|
||||
(True,),
|
||||
(False,),
|
||||
)
|
||||
def test_compressed_css(self, pipeline_enabled, mock_staticfiles_lookup):
|
||||
def test_compressed_css(self, pipeline_enabled, mock_staticfiles_lookup): # lint-amnesty, pylint: disable=unused-argument
|
||||
"""
|
||||
Verify the behavior of compressed_css, with the pipeline
|
||||
both enabled and disabled.
|
||||
@@ -73,7 +73,7 @@ class PipelineRenderTest(TestCase):
|
||||
|
||||
@patch('django.contrib.staticfiles.storage.staticfiles_storage.exists', return_value=True)
|
||||
@patch('common.djangoapps.static_replace.try_staticfiles_lookup', side_effect=mock_staticfiles_lookup)
|
||||
def test_compressed_js(self, mock_staticfiles_lookup, mock_staticfiles_exists):
|
||||
def test_compressed_js(self, mock_staticfiles_lookup, mock_staticfiles_exists): # lint-amnesty, pylint: disable=unused-argument
|
||||
"""
|
||||
Verify the behavior of compressed_css, with the pipeline
|
||||
both enabled and disabled.
|
||||
|
||||
Reference in New Issue
Block a user