Commit ddc46833 by Giovanni Di Milia

Fixed pylint violation for files in lms/

parent 2b5810db
......@@ -34,12 +34,12 @@ class TemplateLookupTests(TestCase):
add_lookup('main', 'external_module', __name__)
directories = LOOKUP['main'].directories
self.assertEqual(len([dir for dir in directories if 'external_module' in dir]), 1)
self.assertEqual(len([directory for directory in directories if 'external_module' in directory]), 1)
# This should not clear the directories list
startup.enable_microsites()
directories = LOOKUP['main'].directories
self.assertEqual(len([dir for dir in directories if 'external_module' in dir]), 1)
self.assertEqual(len([directory for directory in directories if 'external_module' in directory]), 1)
@patch.dict('django.conf.settings.FEATURES', {'ENABLE_FEEDBACK_SUBMISSION': True})
......
"""
URLs for LMS
"""
from django.conf import settings
from django.conf.urls import patterns, include, url
from ratelimitbackend import admin
......@@ -27,7 +31,9 @@ urlpatterns = (
url(r'^event$', 'track.views.user_track'),
url(r'^performance$', 'performance.views.performance_log'),
url(r'^segmentio/event$', 'track.views.segmentio.segmentio_event'),
url(r'^t/(?P<template>[^/]*)$', 'static_template_view.views.index'), # TODO: Is this used anymore? What is STATIC_GRAB?
# TODO: Is this used anymore? What is STATIC_GRAB?
url(r'^t/(?P<template>[^/]*)$', 'static_template_view.views.index'),
url(r'^accounts/manage_user_standing', 'student.views.manage_user_standing',
name='manage_user_standing'),
......@@ -313,15 +319,20 @@ if settings.COURSEWARE_ENABLED:
# into the database.
url(r'^software-licenses$', 'licenses.views.user_software_license', name="user_software_license"),
url(r'^courses/{}/xqueue/(?P<userid>[^/]*)/(?P<mod_id>.*?)/(?P<dispatch>[^/]*)$'.format(settings.COURSE_ID_PATTERN),
url(
r'^courses/{}/xqueue/(?P<userid>[^/]*)/(?P<mod_id>.*?)/(?P<dispatch>[^/]*)$'.format(
settings.COURSE_ID_PATTERN
),
'courseware.module_render.xqueue_callback',
name='xqueue_callback'),
name='xqueue_callback'
),
url(r'^change_setting$', 'student.views.change_setting',
name='change_setting'),
# TODO: These views need to be updated before they work
url(r'^calculate$', 'util.views.calculate'),
# TODO: We should probably remove the circuit package. I believe it was only used in the old way of saving wiki circuits for the wiki
# TODO: We should probably remove the circuit package. I believe it was only used in the old way of saving wiki
# circuits for the wiki
# url(r'^edit_circuit/(?P<circuit>[^/]*)$', 'circuit.views.edit_circuit'),
# url(r'^save_circuit/(?P<circuit>[^/]*)$', 'circuit.views.save_circuit'),
......@@ -339,8 +350,9 @@ if settings.COURSEWARE_ENABLED:
'courseware.views.course_info', name="course_root"),
url(r'^courses/{}/info$'.format(settings.COURSE_ID_PATTERN),
'courseware.views.course_info', name="info"),
# TODO arjun remove when custom tabs in place, see courseware/courses.py
url(r'^courses/{}/syllabus$'.format(settings.COURSE_ID_PATTERN),
'courseware.views.syllabus', name="syllabus"), # TODO arjun remove when custom tabs in place, see courseware/courses.py
'courseware.views.syllabus', name="syllabus"),
#Survey associated with a course
url(r'^courses/{}/survey$'.format(settings.COURSE_ID_PATTERN),
......@@ -358,8 +370,12 @@ if settings.COURSEWARE_ENABLED:
url(r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/$'.format(settings.COURSE_ID_PATTERN),
'staticbook.views.pdf_index', name="pdf_book"),
url(r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/(?P<page>\d+)$'.format(settings.COURSE_ID_PATTERN),
'staticbook.views.pdf_index', name="pdf_book"),
url(
r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/(?P<page>\d+)$'.format(
settings.COURSE_ID_PATTERN
),
'staticbook.views.pdf_index', name="pdf_book"
),
url(r'^courses/{}/htmlbook/(?P<book_index>\d+)/$'.format(settings.COURSE_ID_PATTERN),
'staticbook.views.html_index', name="html_book"),
......@@ -372,8 +388,12 @@ if settings.COURSEWARE_ENABLED:
'courseware.views.index', name="courseware_chapter"),
url(r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'.format(settings.COURSE_ID_PATTERN),
'courseware.views.index', name="courseware_section"),
url(r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/(?P<position>[^/]*)/?$'.format(settings.COURSE_ID_PATTERN),
'courseware.views.index', name="courseware_position"),
url(
r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/(?P<position>[^/]*)/?$'.format(
settings.COURSE_ID_PATTERN
),
'courseware.views.index', name="courseware_position"
),
url(r'^courses/{}/progress$'.format(settings.COURSE_ID_PATTERN),
'courseware.views.progress', name="progress"),
......@@ -512,7 +532,10 @@ if settings.COURSEWARE_ENABLED:
if settings.FEATURES.get('ENABLE_STUDENT_HISTORY_VIEW'):
urlpatterns += (
url(r'^courses/{}/submission_history/(?P<student_username>[^/]*)/(?P<location>.*?)$'.format(settings.COURSE_ID_PATTERN),
url(
r'^courses/{}/submission_history/(?P<student_username>[^/]*)/(?P<location>.*?)$'.format(
settings.COURSE_ID_PATTERN
),
'courseware.views.submission_history',
name='submission_history'),
)
......@@ -580,7 +603,11 @@ urlpatterns += (
if settings.FEATURES.get('AUTH_USE_OPENID_PROVIDER'):
urlpatterns += (
url(r'^openid/provider/login/$', 'external_auth.views.provider_login', name='openid-provider-login'),
url(r'^openid/provider/login/(?:.+)$', 'external_auth.views.provider_identity', name='openid-provider-login-identity'),
url(
r'^openid/provider/login/(?:.+)$',
'external_auth.views.provider_identity',
name='openid-provider-login-identity'
),
url(r'^openid/provider/identity/$', 'external_auth.views.provider_identity', name='openid-provider-identity'),
url(r'^openid/provider/xrds/$', 'external_auth.views.provider_xrds', name='openid-provider-xrds')
)
......@@ -595,7 +622,10 @@ if settings.FEATURES.get('ENABLE_LMS_MIGRATION'):
urlpatterns += (
url(r'^migrate/modules$', 'lms_migration.migrate.manage_modulestores'),
url(r'^migrate/reload/(?P<reload_dir>[^/]+)$', 'lms_migration.migrate.manage_modulestores'),
url(r'^migrate/reload/(?P<reload_dir>[^/]+)/(?P<commit_id>[^/]+)$', 'lms_migration.migrate.manage_modulestores'),
url(
r'^migrate/reload/(?P<reload_dir>[^/]+)/(?P<commit_id>[^/]+)$',
'lms_migration.migrate.manage_modulestores'
),
url(r'^gitreload$', 'lms_migration.migrate.gitreload'),
url(r'^gitreload/(?P<reload_dir>[^/]+)$', 'lms_migration.migrate.gitreload'),
)
......@@ -613,7 +643,11 @@ if settings.FEATURES.get('ENABLE_SERVICE_STATUS'):
if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
urlpatterns += (
url(r'^instructor_task_status/$', 'instructor_task.views.instructor_task_status', name='instructor_task_status'),
url(
r'^instructor_task_status/$',
'instructor_task.views.instructor_task_status',
name='instructor_task_status'
),
)
if settings.FEATURES.get('RUN_AS_ANALYTICS_SERVER_ENABLED'):
......
"""
WSGI config for LMS.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments.
It exposes a module-level variable named ``application``. Django's
``runserver`` and ``runfcgi`` commands discover this application via the
``WSGI_APPLICATION`` setting.
"""
# Patch the xml libs
from safe_lxml import defuse_xml_libs
defuse_xml_libs()
......@@ -25,4 +35,4 @@ modulestore()
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
application = get_wsgi_application() # pylint: disable=invalid-name
"""
Apache WSGI file for LMS
This module contains the WSGI application used for Apache deployment.
It exposes a module-level variable named ``application``.
"""
# Patch the xml libs before anything else.
from safe_lxml import defuse_xml_libs
defuse_xml_libs()
......@@ -13,4 +20,4 @@ startup.run()
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
application = get_wsgi_application() # pylint: disable=invalid-name
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment