From f58e96a2fad171ffc2f87b9e0c06baa8c49f8632 Mon Sep 17 00:00:00 2001 From: Andy Armstrong Date: Fri, 9 Jan 2015 15:27:17 -0500 Subject: [PATCH] Fix quality failures --- .../xmodule/modulestore/tests/test_mixed_modulestore.py | 7 ++++--- lms/djangoapps/courseware/access.py | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py index b0ec1dc447..4c4a4696df 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py @@ -946,19 +946,20 @@ class TestMixedModuleStore(CourseComparisonTest): self.assertEqual(new_parent_location, self.store.get_item(child_to_move_location).get_parent().location) with self.store.branch_setting(ModuleStoreEnum.Branch.published_only): self.assertEqual(old_parent_location, self.store.get_item(child_to_move_location).get_parent().location) - + old_parent_published_location = old_parent_location.for_branch(ModuleStoreEnum.BranchName.published) self.verify_get_parent_locations_results([ (child_to_move_location, new_parent_location, None), (child_to_move_location, new_parent_location, ModuleStoreEnum.RevisionOption.draft_preferred), - (child_to_move_location, old_parent_location.for_branch(ModuleStoreEnum.BranchName.published), ModuleStoreEnum.RevisionOption.published_only), + (child_to_move_location, old_parent_published_location, ModuleStoreEnum.RevisionOption.published_only), ]) # publish the course again self.store.publish(self.course.location, self.user_id) + new_parent_published_location = new_parent_location.for_branch(ModuleStoreEnum.BranchName.published) self.verify_get_parent_locations_results([ (child_to_move_location, new_parent_location, None), (child_to_move_location, new_parent_location, ModuleStoreEnum.RevisionOption.draft_preferred), - (child_to_move_location, new_parent_location.for_branch(ModuleStoreEnum.BranchName.published), ModuleStoreEnum.RevisionOption.published_only), + (child_to_move_location, new_parent_published_location, ModuleStoreEnum.RevisionOption.published_only), ]) @ddt.data('draft') diff --git a/lms/djangoapps/courseware/access.py b/lms/djangoapps/courseware/access.py index e0fac92929..ca204b3868 100644 --- a/lms/djangoapps/courseware/access.py +++ b/lms/djangoapps/courseware/access.py @@ -358,9 +358,7 @@ def _has_group_access(descriptor, user, course_key): # finally: check that the user has a satisfactory group assignment # for each partition. - if not all( - user_groups.get(partition.id) in groups for partition, groups in partition_groups - ): + if not all(user_groups.get(partition.id) in groups for partition, groups in partition_groups): return False # all checks passed.