From 68ef001c919c04702d2c42c3629e2a24a5a93d63 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 25 Jul 2024 10:24:36 -0400 Subject: [PATCH 1/2] fix: Remove errant pluses from a bad merge. --- common/djangoapps/util/file.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/util/file.py b/common/djangoapps/util/file.py index b884ca46a7..b2892e6f42 100644 --- a/common/djangoapps/util/file.py +++ b/common/djangoapps/util/file.py @@ -80,10 +80,10 @@ def store_uploaded_file( stored_file_name = file_storage.save(stored_file_name, uploaded_file) if is_private and settings.DEFAULT_FILE_STORAGE == 'storages.backends.s3boto3.S3Boto3Storage': S3Boto3Storage().connection.meta.client.put_object_acl( -+ ACL='private', -+ Bucket=settings.AWS_STORAGE_BUCKET_NAME, -+ Key=stored_file_name, -+ ) + ACL='private', + Bucket=settings.AWS_STORAGE_BUCKET_NAME, + Key=stored_file_name, + ) if validator: try: From 1fa8e07f1cb5771c05a4b20e13c464df0956992a Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 25 Jul 2024 10:49:14 -0400 Subject: [PATCH 2/2] style: Fix a pylint and other style violations. --- cms/djangoapps/contentstore/utils.py | 3 ++- cms/djangoapps/contentstore/views/library.py | 2 +- cms/djangoapps/contentstore/views/tests/test_library.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index d75ebdb3f2..b268bd6fcb 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -1699,7 +1699,8 @@ def get_home_context(request, no_course=False): 'library_authoring_mfe_url': LIBRARY_AUTHORING_MICROFRONTEND_URL, 'taxonomy_list_mfe_url': get_taxonomy_list_url(), 'libraries': libraries, - 'show_new_library_button': user_can_view_create_library_button(user) and not should_redirect_to_library_authoring_mfe(), + 'show_new_library_button': user_can_view_create_library_button(user) + and not should_redirect_to_library_authoring_mfe(), 'user': user, 'request_course_creator_url': reverse('request_course_creator'), 'course_creator_status': _get_course_creator_status(user), diff --git a/cms/djangoapps/contentstore/views/library.py b/cms/djangoapps/contentstore/views/library.py index 7ba80bcab9..870c192653 100644 --- a/cms/djangoapps/contentstore/views/library.py +++ b/cms/djangoapps/contentstore/views/library.py @@ -68,6 +68,7 @@ def should_redirect_to_library_authoring_mfe(): REDIRECT_TO_LIBRARY_AUTHORING_MICROFRONTEND.is_enabled() ) + def user_can_view_create_library_button(user): """ Helper method for displaying the visibilty of the create_library_button. @@ -92,7 +93,6 @@ def user_can_view_create_library_button(user): return not disable_course_creation - def user_can_create_library(user, org): """ Helper method for returning the library creation status for a particular user, diff --git a/cms/djangoapps/contentstore/views/tests/test_library.py b/cms/djangoapps/contentstore/views/tests/test_library.py index fdbb9d905c..fa65054197 100644 --- a/cms/djangoapps/contentstore/views/tests/test_library.py +++ b/cms/djangoapps/contentstore/views/tests/test_library.py @@ -111,7 +111,7 @@ class UnitTestLibraries(CourseTestCase): self.assertEqual(user_can_create_library(nostaff_user, 'SomEOtherOrg'), False) # When creator groups are enabled, course instructor members can create libraries - # but only in the org they are course staff for. + # but only in the org they are course staff for. @mock.patch("cms.djangoapps.contentstore.views.library.LIBRARIES_ENABLED", True) def test_library_creator_status_with_course_instructor_role_for_enabled_creator_group_setting(self): _, nostaff_user = self.create_non_staff_authed_user_client()