Commit c535a6b9 by Sarina Canelake

Opaque-keys: fix pep8 violations

parent b56e12ff
......@@ -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
......
......@@ -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
......
......@@ -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):
"""
......
......@@ -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())
......
......@@ -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)
......
......@@ -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)
......
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