From c535a6b933c0fe435410106263a2a073bd8fb99b Mon Sep 17 00:00:00 2001 From: Sarina Canelake Date: Thu, 22 May 2014 14:35:19 -0400 Subject: [PATCH] Opaque-keys: fix pep8 violations --- common/djangoapps/course_groups/cohorts.py | 1 + common/djangoapps/student/tests/test_roles.py | 1 - common/lib/xmodule/xmodule/modulestore/locator.py | 7 +++---- .../xmodule/modulestore/tests/test_locators.py | 12 ++++++------ lms/djangoapps/bulk_email/forms.py | 2 +- lms/djangoapps/bulk_email/tasks.py | 1 - 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/common/djangoapps/course_groups/cohorts.py b/common/djangoapps/course_groups/cohorts.py index 636aae326e..45e38112d8 100644 --- a/common/djangoapps/course_groups/cohorts.py +++ b/common/djangoapps/course_groups/cohorts.py @@ -32,6 +32,7 @@ def local_random(): return _local_random + def is_course_cohorted(course_key): """ Given a course key, return a boolean for whether or not the course is diff --git a/common/djangoapps/student/tests/test_roles.py b/common/djangoapps/student/tests/test_roles.py index 14b62673fa..3b3292cd84 100644 --- a/common/djangoapps/student/tests/test_roles.py +++ b/common/djangoapps/student/tests/test_roles.py @@ -132,7 +132,6 @@ class RolesTestCase(TestCase): "Student doesn't have access to {}".format(unicode(self.course_id)) ) - def test_get_user_for_role(self): """ test users_for_role diff --git a/common/lib/xmodule/xmodule/modulestore/locator.py b/common/lib/xmodule/xmodule/modulestore/locator.py index e164216552..ad11f0ff84 100644 --- a/common/lib/xmodule/xmodule/modulestore/locator.py +++ b/common/lib/xmodule/xmodule/modulestore/locator.py @@ -88,13 +88,12 @@ class BlockLocatorBase(Locator): ({BLOCK_TYPE_PREFIX}\+(?P{ALLOWED_ID_CHARS}+)\+?)? ({BLOCK_PREFIX}\+(?P{ALLOWED_ID_CHARS}+))? """.format( - ALLOWED_ID_CHARS=Locator.ALLOWED_ID_CHARS, BRANCH_PREFIX=BRANCH_PREFIX, - VERSION_PREFIX=Locator.VERSION_PREFIX, BLOCK_TYPE_PREFIX=Locator.BLOCK_TYPE_PREFIX, BLOCK_PREFIX=BLOCK_PREFIX - ) + ALLOWED_ID_CHARS=Locator.ALLOWED_ID_CHARS, BRANCH_PREFIX=BRANCH_PREFIX, + VERSION_PREFIX=Locator.VERSION_PREFIX, BLOCK_TYPE_PREFIX=Locator.BLOCK_TYPE_PREFIX, BLOCK_PREFIX=BLOCK_PREFIX + ) URL_RE = re.compile('^' + URL_RE_SOURCE + '$', re.IGNORECASE | re.VERBOSE | re.UNICODE) - @classmethod def parse_url(cls, string): """ diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_locators.py b/common/lib/xmodule/xmodule/modulestore/tests/test_locators.py index eaea216e7c..3c60ebb3c4 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_locators.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_locators.py @@ -158,12 +158,12 @@ class LocatorTest(TestCase): ) testobj = UsageKey.from_string(testurn) self.check_block_locn_fields( - testobj, - org=expected_org, - offering=expected_offering, - branch=expected_branch, - block_type='problem', - block=expected_block_ref + testobj, + org=expected_org, + offering=expected_offering, + branch=expected_branch, + block_type='problem', + block=expected_block_ref ) self.assertEqual(unicode(testobj), testurn) testobj = testobj.for_version(ObjectId()) diff --git a/lms/djangoapps/bulk_email/forms.py b/lms/djangoapps/bulk_email/forms.py index 326a114ba1..f62d28e03b 100644 --- a/lms/djangoapps/bulk_email/forms.py +++ b/lms/djangoapps/bulk_email/forms.py @@ -67,7 +67,7 @@ class CourseAuthorizationAdminForm(forms.ModelForm): # pylint: disable=R0924 try: course_key = SlashSeparatedCourseKey.from_deprecated_string(cleaned_id) except InvalidKeyError: - msg = u'Course id invalid.' + msg = u'Course id invalid.' msg += u' --- Entered course id was: "{0}". '.format(cleaned_id) msg += 'Please recheck that you have supplied a valid course id.' raise forms.ValidationError(msg) diff --git a/lms/djangoapps/bulk_email/tasks.py b/lms/djangoapps/bulk_email/tasks.py index 16ce53f112..71f15206fc 100644 --- a/lms/djangoapps/bulk_email/tasks.py +++ b/lms/djangoapps/bulk_email/tasks.py @@ -192,7 +192,6 @@ def perform_delegate_email_batches(entry_id, course_id, task_input, action_name) log.warning(u"Task %s: " + format_msg, task_id, course_id, email_obj.course_id) raise ValueError(format_msg % (course_id, email_obj.course_id)) - # Fetch the course object. course = get_course(course_id)