Clean up pylint errors to get diff-quality to pass
This commit is contained in:
@@ -444,7 +444,7 @@ class CourseEntitlement(TimeStampedModel):
|
||||
refund_successful = refund_entitlement(course_entitlement=self)
|
||||
if not refund_successful:
|
||||
# This state is achieved in most cases by a failure in the ecommerce service to process the refund.
|
||||
log.warn(
|
||||
log.warning(
|
||||
u'Entitlement Refund failed for Course Entitlement [%s], alert User',
|
||||
self.uuid
|
||||
)
|
||||
|
||||
@@ -166,7 +166,7 @@ class ConditionalModule(ConditionalFields, XModule, StudioEditableModule):
|
||||
if module is not None:
|
||||
# We do not want to log when module is None, and it is when requester
|
||||
# does not have access to the requested required module.
|
||||
log.warn('Error in conditional module: \
|
||||
log.warning('Error in conditional module: \
|
||||
required module {module} has no {module_attr}'.format(module=module, module_attr=attr_name))
|
||||
return False
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ class SplitMigrator(object):
|
||||
draft_location, revision=ModuleStoreEnum.RevisionOption.draft_preferred, **kwargs
|
||||
)
|
||||
if parent_loc is None:
|
||||
log.warn(u'No parent found in source course for %s', draft_location)
|
||||
log.warning(u'No parent found in source course for %s', draft_location)
|
||||
continue
|
||||
old_parent = self.source_modulestore.get_item(parent_loc, **kwargs)
|
||||
split_parent_loc = new_draft_course_loc.make_usage_key(
|
||||
|
||||
@@ -69,7 +69,7 @@ def rewrite_video_url(cdn_base_url, original_video_url):
|
||||
validator(rewritten_url)
|
||||
return rewritten_url
|
||||
except ValidationError:
|
||||
log.warn("Invalid CDN rewrite URL encountered, %s", rewritten_url)
|
||||
log.warning("Invalid CDN rewrite URL encountered, %s", rewritten_url)
|
||||
|
||||
# Mimic the behavior of removed get_video_from_cdn in this regard and
|
||||
# return None causing the caller to use the original URL.
|
||||
|
||||
@@ -208,7 +208,7 @@ def refund_entitlement(course_entitlement):
|
||||
always_notify=True,
|
||||
)
|
||||
else:
|
||||
log.warn(u'No refund opened for user [%s], course entitlement [%s]', enrollee.id, entitlement_uuid)
|
||||
log.warning(u'No refund opened for user [%s], course entitlement [%s]', enrollee.id, entitlement_uuid)
|
||||
return False
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# pylint: disable=missing-docstring,unused-argument,model-missing-unicode
|
||||
# pylint: disable=missing-docstring,unused-argument
|
||||
|
||||
|
||||
import json
|
||||
|
||||
@@ -41,7 +41,6 @@ class CountryMiddleware(MiddlewareMixin):
|
||||
reader = geoip2.database.Reader(settings.GEOIP_PATH)
|
||||
try:
|
||||
response = reader.country(new_ip_address)
|
||||
# pylint: disable=no-member
|
||||
country_code = response.country.iso_code
|
||||
except geoip2.errors.AddressNotFoundError:
|
||||
country_code = ""
|
||||
|
||||
@@ -4,9 +4,6 @@ Test site_configuration middleware.
|
||||
"""
|
||||
|
||||
|
||||
from mock import patch
|
||||
|
||||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
from django.test.client import Client
|
||||
from django.test.utils import override_settings
|
||||
|
||||
Reference in New Issue
Block a user