Pylint fixes to move number below allowed threshold.
This commit is contained in:
@@ -40,13 +40,13 @@ factory = APIRequestFactory() # pylint: disable=invalid-name
|
||||
class MockView(APIView): # pylint: disable=missing-docstring
|
||||
permission_classes = (IsAuthenticated,)
|
||||
|
||||
def get(self, request): # pylint: disable=missing-docstring,unused-argument
|
||||
def get(self, request): # pylint: disable=unused-argument
|
||||
return HttpResponse({'a': 1, 'b': 2, 'c': 3})
|
||||
|
||||
def post(self, request): # pylint: disable=missing-docstring,unused-argument
|
||||
def post(self, request): # pylint: disable=unused-argument
|
||||
return HttpResponse({'a': 1, 'b': 2, 'c': 3})
|
||||
|
||||
def put(self, request): # pylint: disable=missing-docstring,unused-argument
|
||||
def put(self, request): # pylint: disable=unused-argument
|
||||
return HttpResponse({'a': 1, 'b': 2, 'c': 3})
|
||||
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ class CourseHomeMessages(UserMessageCollection):
|
||||
NAMESPACE = 'course_home_level_messages'
|
||||
|
||||
@classmethod
|
||||
def get_namespace(self):
|
||||
def get_namespace(cls):
|
||||
"""
|
||||
Returns the namespace of the message collection.
|
||||
"""
|
||||
return self.NAMESPACE
|
||||
return cls.NAMESPACE
|
||||
|
||||
@@ -6,13 +6,13 @@ This includes any locally defined CourseTools.
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from course_tools import CourseTool
|
||||
from courseware.courses import get_course_by_id
|
||||
from student.models import CourseEnrollment
|
||||
from views.course_reviews import CourseReviewsModuleFragmentView
|
||||
from views.course_updates import CourseUpdatesFragmentView
|
||||
|
||||
from . import SHOW_REVIEWS_TOOL_FLAG, UNIFIED_COURSE_TAB_FLAG
|
||||
from .course_tools import CourseTool
|
||||
from .views.course_reviews import CourseReviewsModuleFragmentView
|
||||
from .views.course_updates import CourseUpdatesFragmentView
|
||||
|
||||
|
||||
class CourseUpdatesTool(CourseTool):
|
||||
|
||||
@@ -36,7 +36,6 @@ class TestCourseOutlinePage(SharedModuleStoreTestCase):
|
||||
Set up an array of various courses to be tested.
|
||||
"""
|
||||
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestCourseOutlinePage, cls).setUpClassAndTestData():
|
||||
cls.courses = []
|
||||
course = CourseFactory.create()
|
||||
@@ -261,7 +260,6 @@ class TestCourseOutlineResumeCourse(SharedModuleStoreTestCase):
|
||||
Creates a test course that can be used for non-destructive tests
|
||||
"""
|
||||
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestCourseOutlineResumeCourse, cls).setUpClassAndTestData():
|
||||
cls.course = cls.create_test_course()
|
||||
|
||||
@@ -369,7 +367,7 @@ class TestCourseOutlineResumeCourse(SharedModuleStoreTestCase):
|
||||
|
||||
# remove one of the sequentials from the chapter
|
||||
with self.store.branch_setting(ModuleStoreEnum.Branch.draft_preferred, course.id):
|
||||
self.store.delete_item(sequential.location, self.user.id) # pylint: disable=no-member
|
||||
self.store.delete_item(sequential.location, self.user.id)
|
||||
|
||||
# check resume course buttons
|
||||
response = self.client.get(course_home_url(course))
|
||||
@@ -398,7 +396,7 @@ class TestCourseOutlineResumeCourse(SharedModuleStoreTestCase):
|
||||
# remove all sequentials from chapter
|
||||
with self.store.branch_setting(ModuleStoreEnum.Branch.draft_preferred, course.id):
|
||||
for sequential in chapter.children:
|
||||
self.store.delete_item(sequential.location, self.user.id) # pylint: disable=no-member
|
||||
self.store.delete_item(sequential.location, self.user.id)
|
||||
|
||||
# check resume course buttons
|
||||
response = self.client.get(course_home_url(course))
|
||||
|
||||
@@ -4,14 +4,14 @@ Defines URLs for the course experience.
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from views.course_dates import CourseDatesFragmentMobileView
|
||||
from views.course_home import CourseHomeFragmentView, CourseHomeView
|
||||
from views.course_outline import CourseOutlineFragmentView
|
||||
from views.course_reviews import CourseReviewsView
|
||||
from views.course_updates import CourseUpdatesFragmentView, CourseUpdatesView
|
||||
from views.course_sock import CourseSockFragmentView
|
||||
from views.latest_update import LatestUpdateFragmentView
|
||||
from views.welcome_message import WelcomeMessageFragmentView, dismiss_welcome_message
|
||||
from .views.course_dates import CourseDatesFragmentMobileView
|
||||
from .views.course_home import CourseHomeFragmentView, CourseHomeView
|
||||
from .views.course_outline import CourseOutlineFragmentView
|
||||
from .views.course_reviews import CourseReviewsView
|
||||
from .views.course_updates import CourseUpdatesFragmentView, CourseUpdatesView
|
||||
from .views.course_sock import CourseSockFragmentView
|
||||
from .views.latest_update import LatestUpdateFragmentView
|
||||
from .views.welcome_message import WelcomeMessageFragmentView, dismiss_welcome_message
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
|
||||
@@ -8,15 +8,20 @@ from babel.dates import format_date, format_timedelta
|
||||
from django.contrib import auth
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.http import urlquote_plus
|
||||
from pytz import UTC
|
||||
from django.utils.translation import get_language, to_locale
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import get_language, to_locale
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from pytz import UTC
|
||||
from web_fragments.fragment import Fragment
|
||||
|
||||
from courseware.courses import get_course_date_blocks, get_course_with_access
|
||||
from lms.djangoapps.course_goals.api import get_course_goal, get_course_goal_options, valid_course_goals_ordered, get_goal_api_url, has_course_goal_permission
|
||||
from lms.djangoapps.course_goals.api import (
|
||||
get_course_goal,
|
||||
get_course_goal_options,
|
||||
get_goal_api_url,
|
||||
has_course_goal_permission,
|
||||
valid_course_goals_ordered
|
||||
)
|
||||
from lms.djangoapps.course_goals.models import GOAL_KEY_CHOICES
|
||||
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
@@ -52,7 +57,9 @@ class CourseHomeMessageFragmentView(EdxFragmentView):
|
||||
# Get time until the start date, if already started, or no start date, value will be zero or negative
|
||||
now = datetime.now(UTC)
|
||||
already_started = course.start and now > course.start
|
||||
days_until_start_string = "started" if already_started else format_timedelta(course.start - now, locale=to_locale(get_language()))
|
||||
days_until_start_string = "started" if already_started else format_timedelta(
|
||||
course.start - now, locale=to_locale(get_language())
|
||||
)
|
||||
course_start_data = {
|
||||
'course_start_date': format_date(course.start, locale=to_locale(get_language())),
|
||||
'already_started': already_started,
|
||||
|
||||
Reference in New Issue
Block a user