Skip to content

Commit

Permalink
Revert "Revert "feat!: upgrading django-storages to 1.10.1 (#32571)" (#…
Browse files Browse the repository at this point in the history
…33109)" (#33111)

This reverts commit 191b825.
  • Loading branch information
awais786 authored Aug 28, 2023
1 parent 191b825 commit 2f8475c
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 23 deletions.
3 changes: 1 addition & 2 deletions 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, 'base_url': '/', 'location': 'abc/def'}}
{'bucket_name': 'test', 'default_acl': None, 'location': 'abc/def'}}
)
def test_boto3_backend_with_params(self):
storage = get_storage_class(
Expand Down Expand Up @@ -417,7 +417,6 @@ 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:
base_url: /media/
location: /edx/var/edxapp/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['STORAGE_KWARGS']['base_url'],
settings.VIDEO_IMAGE_SETTINGS['BASE_URL'],
document_root=settings.VIDEO_IMAGE_SETTINGS['STORAGE_KWARGS']['location']
)

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

Expand Down
5 changes: 3 additions & 2 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3801,9 +3801,10 @@ 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 @@ -3817,9 +3818,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:
base_url: /media/
location: /edx/var/edxapp/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:
base_url: /media/
location: /edx/var/edxapp/media//
location: edx/var/edxapp/media//
VIDEO_TRANSCRIPTS_MAX_BYTES: 3145728
BASE_URL: /media/
VIDEO_UPLOAD_PIPELINE:
BUCKET: ''
ROOT_PATH: ''
Expand Down
5 changes: 2 additions & 3 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ 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.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
# django-storages version 1.10.1 is major upgrade and require multiple settings changes.
django-storages==1.10.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.9.1
django-storages==1.10.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.9.1
django-storages==1.10.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.9.1
django-storages==1.10.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.9.1
django-storages==1.10.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down

0 comments on commit 2f8475c

Please sign in to comment.