diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index ea1cee8d62..bc37e8fd41 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -52,19 +52,13 @@ def see_a_multi_step_component(step, category): world.wait_for(lambda _: len(world.css_find(selector)) == len(step.hashes)) for idx, step_hash in enumerate(step.hashes): - if category == 'HTML': html_matcher = { - 'Text': - '\n \n', - 'Announcement': - '
Words of encouragement! This is a short note that most students will read.
', - 'Zooming Image': - 'This template is similar to the Text template. The only difference is', + 'Text': '\n \n', + 'Announcement': '
Words of encouragement! This is a short note that most students will read.
', + 'Zooming Image': 'This template is similar to the Text template. The only difference is', } actual_html = world.css_html(selector, index=idx) assert_in(html_matcher[step_hash['Component']], actual_html) diff --git a/cms/djangoapps/contentstore/views/assets.py b/cms/djangoapps/contentstore/views/assets.py index e8924fe7c9..95baa62747 100644 --- a/cms/djangoapps/contentstore/views/assets.py +++ b/cms/djangoapps/contentstore/views/assets.py @@ -190,8 +190,8 @@ def _upload_asset(request, course_key): # first let's see if a thumbnail can be created (thumbnail_content, thumbnail_location) = contentstore().generate_thumbnail( - content, - tempfile_path=tempfile_path + content, + tempfile_path=tempfile_path, ) # delete cached thumbnail even if one couldn't be created this time (else diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index 5d5529aaf3..69440fe1d8 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -387,10 +387,13 @@ def course_listing(request): 'run': uca.course_key.run, 'is_failed': True if uca.state == CourseRerunUIStateManager.State.FAILED else False, 'is_in_progress': True if uca.state == CourseRerunUIStateManager.State.IN_PROGRESS else False, - 'dismiss_link': - reverse_course_url('course_notifications_handler', uca.course_key, kwargs={ + 'dismiss_link': reverse_course_url( + 'course_notifications_handler', + uca.course_key, + kwargs={ 'action_state_id': uca.id, - }) if uca.state == CourseRerunUIStateManager.State.FAILED else '' + }, + ) if uca.state == CourseRerunUIStateManager.State.FAILED else '' } # remove any courses in courses that are also in the in_process_course_actions list @@ -456,10 +459,13 @@ def course_index(request, course_key): 'rerun_notification_id': current_action.id if current_action else None, 'course_release_date': course_release_date, 'settings_url': settings_url, - 'notification_dismiss_url': - reverse_course_url('course_notifications_handler', current_action.course_key, kwargs={ + 'notification_dismiss_url': reverse_course_url( + 'course_notifications_handler', + current_action.course_key, + kwargs={ 'action_state_id': current_action.id, - }) if current_action else None, + }, + ) if current_action else None, }) diff --git a/common/djangoapps/student/middleware.py b/common/djangoapps/student/middleware.py index 610a00d85a..055a76309f 100644 --- a/common/djangoapps/student/middleware.py +++ b/common/djangoapps/student/middleware.py @@ -24,15 +24,13 @@ class UserStandingMiddleware(object): else: if user_account.account_status == UserStanding.ACCOUNT_DISABLED: msg = _( - 'Your account has been disabled. If you believe ' - 'this was done in error, please contact us at ' - '{link_start}{support_email}{link_end}' + 'Your account has been disabled. If you believe ' + 'this was done in error, please contact us at ' + '{support_email}' ).format( - support_email=settings.DEFAULT_FEEDBACK_EMAIL, - link_start=u''.format( - address=settings.DEFAULT_FEEDBACK_EMAIL, - subject_line=_('Disabled Account'), - ), - link_end=u'' + support_email=u'{address}'.format( + address=settings.DEFAULT_FEEDBACK_EMAIL, + subject_line=_('Disabled Account'), + ), ) return HttpResponseForbidden(msg) diff --git a/common/lib/capa/capa/registry.py b/common/lib/capa/capa/registry.py index fedb029fe2..af2156a686 100644 --- a/common/lib/capa/capa/registry.py +++ b/common/lib/capa/capa/registry.py @@ -24,15 +24,20 @@ class TagRegistry(object): if len(cls.tags) == 0: raise ValueError("No tags specified for class {0}".format(cls.__name__)) - for t in cls.tags: - if t in self._mapping: - other_cls = self._mapping[t] + for tag in cls.tags: + if tag in self._mapping: + other_cls = self._mapping[tag] if cls == other_cls: # registering the same class multiple times seems silly, but ok continue - raise ValueError("Tag {0} already registered by class {1}." - " Can't register for class {2}" - .format(t, other_cls.__name__, cls.__name__)) + raise ValueError( + "Tag {0} already registered by class {1}." + " Can't register for class {2}".format( + tag, + other_cls.__name__, + cls.__name__, + ) + ) # Ok, should be good to change state now. for t in cls.tags: diff --git a/common/lib/sandbox-packages/verifiers/draganddrop.py b/common/lib/sandbox-packages/verifiers/draganddrop.py index 66c3835be9..9a3a000902 100644 --- a/common/lib/sandbox-packages/verifiers/draganddrop.py +++ b/common/lib/sandbox-packages/verifiers/draganddrop.py @@ -368,7 +368,8 @@ class DragAndDrop(object): if draggable_name in answer['draggables']: user_groups_data.append(draggable_name) user_positions_data.append( - draggable_dict[draggable_name]) + draggable_dict[draggable_name] + ) # proved that this is not excess self.excess_draggables[draggable_name] = False diff --git a/lms/djangoapps/open_ended_grading/staff_grading_service.py b/lms/djangoapps/open_ended_grading/staff_grading_service.py index 81baf721c2..0aeed52da2 100644 --- a/lms/djangoapps/open_ended_grading/staff_grading_service.py +++ b/lms/djangoapps/open_ended_grading/staff_grading_service.py @@ -57,15 +57,25 @@ class MockStaffGradingService(object): def get_problem_list(self, course_id, grader_id): self.cnt += 1 - return {'success': True, - 'problem_list': [ - json.dumps({'location': 'i4x://MITx/3.091x/problem/open_ended_demo1', - 'problem_name': "Problem 1", 'num_graded': 3, 'num_pending': 5, - 'min_for_ml': 10}), - json.dumps({'location': 'i4x://MITx/3.091x/problem/open_ended_demo2', - 'problem_name': "Problem 2", 'num_graded': 1, 'num_pending': 5, - 'min_for_ml': 10}) - ]} + return { + 'success': True, + 'problem_list': [ + json.dumps({ + 'location': 'i4x://MITx/3.091x/problem/open_ended_demo1', + 'problem_name': "Problem 1", + 'num_graded': 3, + 'num_pending': 5, + 'min_for_ml': 10, + }), + json.dumps({ + 'location': 'i4x://MITx/3.091x/problem/open_ended_demo2', + 'problem_name': "Problem 2", + 'num_graded': 1, + 'num_pending': 5, + 'min_for_ml': 10, + }), + ], + } def save_grade(self, course_id, grader_id, submission_id, score, feedback, skipped, rubric_scores, submission_flagged):