Apply pylint-amnesty.
This commit is contained in:
Awais Qureshi
2021-02-02 11:37:56 +05:00
parent eba1e282da
commit 07599e930c
14 changed files with 29 additions and 29 deletions

View File

@@ -14,11 +14,11 @@ from common.djangoapps.student.models import CourseEnrollment, User
from common.djangoapps.util.course import get_encoded_course_sharing_utm_params, get_link_for_about_page
class CourseOverviewField(serializers.RelatedField):
class CourseOverviewField(serializers.RelatedField): # lint-amnesty, pylint: disable=abstract-method
"""
Custom field to wrap a CourseOverview object. Read-only.
"""
def to_representation(self, course_overview):
def to_representation(self, course_overview): # lint-amnesty, pylint: disable=arguments-differ
course_id = six.text_type(course_overview.id)
request = self.context.get('request')
api_version = self.context.get('api_version')

View File

@@ -118,13 +118,13 @@ class TestUserEnrollmentApi(UrlResetMixin, MobileAPITestCase, MobileAuthUserTest
@patch.dict(settings.FEATURES, {"ENABLE_DISCUSSION_SERVICE": True})
def setUp(self):
super(TestUserEnrollmentApi, self).setUp()
super(TestUserEnrollmentApi, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
def verify_success(self, response):
"""
Verifies user course enrollment response for success
"""
super(TestUserEnrollmentApi, self).verify_success(response)
super(TestUserEnrollmentApi, self).verify_success(response) # lint-amnesty, pylint: disable=super-with-arguments
courses = response.data
self.assertEqual(len(courses), 1)
@@ -299,7 +299,7 @@ class TestUserEnrollmentApi(UrlResetMixin, MobileAPITestCase, MobileAuthUserTest
self.create_enrollment(expired)
return self.api_response(api_version=api_version).data
def _assert_enrollment_results(self, api_version, courses, num_courses_returned, gating_enabled=True):
def _assert_enrollment_results(self, api_version, courses, num_courses_returned, gating_enabled=True): # lint-amnesty, pylint: disable=missing-function-docstring
self.assertEqual(len(courses), num_courses_returned)
if api_version == API_V05:
@@ -425,7 +425,7 @@ class CourseStatusAPITestCase(MobileAPITestCase):
"""
Creates a basic course structure for our course
"""
super(CourseStatusAPITestCase, self).setUp()
super(CourseStatusAPITestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.section = ItemFactory.create(
parent=self.course,
@@ -591,7 +591,7 @@ class TestCourseEnrollmentSerializer(MobileAPITestCase, MilestonesTestCaseMixin)
ENABLED_SIGNALS = ['course_published']
def setUp(self):
super(TestCourseEnrollmentSerializer, self).setUp()
super(TestCourseEnrollmentSerializer, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.login_and_enroll()
self.request = RequestFactory().get('/')
self.request.user = self.user

View File

@@ -16,7 +16,7 @@ from rest_framework.decorators import api_view
from rest_framework.response import Response
from xblock.fields import Scope
from xblock.runtime import KeyValueStore
from django.contrib.auth.models import User
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from lms.djangoapps.courseware.access import is_mobile_available_for_user
from lms.djangoapps.courseware.courses import get_current_child
@@ -26,7 +26,7 @@ from lms.djangoapps.courseware.views.index import save_positions_recursively_up
from lms.djangoapps.courseware.access_utils import ACCESS_GRANTED
from lms.djangoapps.mobile_api.utils import API_V05, API_V1
from openedx.features.course_duration_limits.access import check_course_expired
from common.djangoapps.student.models import CourseEnrollment, User
from common.djangoapps.student.models import CourseEnrollment, User # lint-amnesty, pylint: disable=reimported
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
@@ -72,7 +72,7 @@ class UserDetail(generics.RetrieveAPIView):
lookup_field = 'username'
def get_serializer_context(self):
context = super(UserDetail, self).get_serializer_context()
context = super(UserDetail, self).get_serializer_context() # lint-amnesty, pylint: disable=super-with-arguments
context['api_version'] = self.kwargs.get('api_version')
return context
@@ -188,7 +188,7 @@ class UserCourseStatus(views.APIView):
return self._get_course_info(request, course)
@mobile_course_access(depth=2)
def get(self, request, course, *args, **kwargs):
def get(self, request, course, *args, **kwargs): # lint-amnesty, pylint: disable=unused-argument
"""
Get the ID of the module that the specified user last visited in the specified course.
"""
@@ -207,7 +207,7 @@ class UserCourseStatus(views.APIView):
return user_course_status
@mobile_course_access(depth=2)
def patch(self, request, course, *args, **kwargs):
def patch(self, request, course, *args, **kwargs): # lint-amnesty, pylint: disable=unused-argument
"""
Update the ID of the module that the specified user last visited in the specified course.
"""
@@ -312,7 +312,7 @@ class UserCourseEnrollmentsList(generics.ListAPIView):
return check_org is None or (check_org.lower() == course_org.lower())
def get_serializer_context(self):
context = super(UserCourseEnrollmentsList, self).get_serializer_context()
context = super(UserCourseEnrollmentsList, self).get_serializer_context() # lint-amnesty, pylint: disable=super-with-arguments
context['api_version'] = self.kwargs.get('api_version')
return context