Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat!: upgrading django-storages to 1.10.1""" #33113

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cms/djangoapps/contentstore/tests/test_video_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def test_video_backend(self):
@override_settings(VIDEO_IMAGE_SETTINGS={
'STORAGE_CLASS': 'storages.backends.s3boto3.S3Boto3Storage',
'STORAGE_KWARGS':
{'bucket_name': 'test', 'default_acl': None, 'location': 'abc/def'}}
{'bucket_name': 'test', 'default_acl': None, 'base_url': '/', 'location': 'abc/def'}}
)
def test_boto3_backend_with_params(self):
storage = get_storage_class(
Expand Down Expand Up @@ -417,6 +417,7 @@ def test_storage_without_global_default_acl_setting(self):
obj.upload_fileobj.assert_called_with(
content,
ExtraArgs={
'ACL': 'public-read', # it will come from 1.9.1
'ContentType': 'text/plain',
}
)
Expand Down
4 changes: 2 additions & 2 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2504,9 +2504,9 @@
# STORAGE_KWARGS=dict(bucket='video-image-bucket'),
STORAGE_KWARGS=dict(
location=MEDIA_ROOT,
base_url=MEDIA_URL,
),
DIRECTORY_PREFIX='video-images/',
BASE_URL=MEDIA_URL,
)

VIDEO_IMAGE_MAX_AGE = 31536000
Expand All @@ -2519,9 +2519,9 @@
# STORAGE_KWARGS=dict(bucket='video-transcripts-bucket'),
STORAGE_KWARGS=dict(
location=MEDIA_ROOT,
base_url=MEDIA_URL,
),
DIRECTORY_PREFIX='video-transcripts/',
BASE_URL=MEDIA_URL,
)

VIDEO_TRANSCRIPTS_MAX_AGE = 31536000
Expand Down
6 changes: 3 additions & 3 deletions cms/envs/devstack-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,17 +512,17 @@ VIDEO_IMAGE_MAX_AGE: 31536000
VIDEO_IMAGE_SETTINGS:
DIRECTORY_PREFIX: video-images/
STORAGE_KWARGS:
base_url: /media/
location: /edx/var/edxapp/media//
VIDEO_IMAGE_MAX_BYTES: 2097152
VIDEO_IMAGE_MIN_BYTES: 2048
BASE_URL: /media/
VIDEO_TRANSCRIPTS_MAX_AGE: 31536000
VIDEO_TRANSCRIPTS_SETTINGS:
DIRECTORY_PREFIX: video-transcripts/
STORAGE_KWARGS:
location: edx/var/edxapp/media//
base_url: /media/
location: /edx/var/edxapp/media//
VIDEO_TRANSCRIPTS_MAX_BYTES: 3145728
BASE_URL: /media/
VIDEO_UPLOAD_PIPELINE:
BUCKET: ''
ROOT_PATH: ''
Expand Down
2 changes: 1 addition & 1 deletion cms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@
VIDEO_IMAGE_MIN_BYTES=2 * 1024, # 2 KB
STORAGE_KWARGS=dict(
location=MEDIA_ROOT,
base_url=MEDIA_URL,
),
DIRECTORY_PREFIX='video-images/',
BASE_URL=MEDIA_URL,
)
VIDEO_IMAGE_DEFAULT_FILENAME = 'default_video_image.png'

Expand Down
4 changes: 2 additions & 2 deletions cms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += static(
settings.VIDEO_IMAGE_SETTINGS['BASE_URL'],
settings.VIDEO_IMAGE_SETTINGS['STORAGE_KWARGS']['base_url'],
document_root=settings.VIDEO_IMAGE_SETTINGS['STORAGE_KWARGS']['location']
)

urlpatterns += static(
settings.VIDEO_TRANSCRIPTS_SETTINGS['BASE_URL'],
settings.VIDEO_TRANSCRIPTS_SETTINGS['STORAGE_KWARGS']['base_url'],
document_root=settings.VIDEO_TRANSCRIPTS_SETTINGS['STORAGE_KWARGS']['location']
)

Expand Down
5 changes: 2 additions & 3 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3801,10 +3801,9 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
# STORAGE_KWARGS=dict(bucket='video-image-bucket'),
STORAGE_KWARGS=dict(
location=MEDIA_ROOT,
base_url=MEDIA_URL,
),
DIRECTORY_PREFIX='video-images/',
BASE_URL=MEDIA_URL,

)

VIDEO_IMAGE_MAX_AGE = 31536000
Expand All @@ -3818,9 +3817,9 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
# STORAGE_KWARGS=dict(bucket='video-transcripts-bucket'),
STORAGE_KWARGS=dict(
location=MEDIA_ROOT,
base_url=MEDIA_URL,
),
DIRECTORY_PREFIX='video-transcripts/',
BASE_URL=MEDIA_URL,
)

VIDEO_TRANSCRIPTS_MAX_AGE = 31536000
Expand Down
8 changes: 4 additions & 4 deletions lms/envs/devstack-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -614,17 +614,17 @@ VIDEO_IMAGE_MAX_AGE: 31536000
VIDEO_IMAGE_SETTINGS:
DIRECTORY_PREFIX: video-images/
STORAGE_KWARGS:
location: edx/var/edxapp/media//
base_url: /media/
location: /edx/var/edxapp/media//
VIDEO_IMAGE_MAX_BYTES: 2097152
VIDEO_IMAGE_MIN_BYTES: 2048
BASE_URL: /media/
VIDEO_TRANSCRIPTS_MAX_AGE: 31536000
VIDEO_TRANSCRIPTS_SETTINGS:
DIRECTORY_PREFIX: video-transcripts/
STORAGE_KWARGS:
location: edx/var/edxapp/media//
base_url: /media/
location: /edx/var/edxapp/media//
VIDEO_TRANSCRIPTS_MAX_BYTES: 3145728
BASE_URL: /media/
VIDEO_UPLOAD_PIPELINE:
BUCKET: ''
ROOT_PATH: ''
Expand Down
5 changes: 3 additions & 2 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ celery>=5.2.2,<6.0.0
# required for celery>=5.2.0;<5.3.0
click>=8.0,<9.0

# django-storages version 1.11.1 is major version upgrade.
django-storages==1.11.1
# django-storages version 1.9 drops support for boto storage backend.
# 1.9 gives an error for details https://github.com/jschneier/django-storages/issues/831
django-storages==1.9.1


# The team that owns this package will manually bump this package rather than having it pulled in automatically.
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ django-statici18n==2.4.0
# -r requirements/edx/kernel.in
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.11.1
django-storages==1.9.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ django-statici18n==2.4.0
# -r requirements/edx/testing.txt
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.11.1
django-storages==1.9.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/doc.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ django-statici18n==2.4.0
# -r requirements/edx/base.txt
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.11.1
django-storages==1.9.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ django-statici18n==2.4.0
# -r requirements/edx/base.txt
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.11.1
django-storages==1.9.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down