Opaque-keys: fix pep8 violations

This commit is contained in:
Sarina Canelake
2014-05-22 14:35:19 -04:00
parent b56e12ff03
commit c535a6b933
6 changed files with 11 additions and 13 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -88,13 +88,12 @@ class BlockLocatorBase(Locator):
({BLOCK_TYPE_PREFIX}\+(?P<block_type>{ALLOWED_ID_CHARS}+)\+?)?
({BLOCK_PREFIX}\+(?P<block_id>{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):
"""

View File

@@ -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())

View File

@@ -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)

View File

@@ -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)