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

Dependencies: don't override get_available_name (Django Storages) #11505

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 0 additions & 11 deletions readthedocs/builds/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
)
from django.core.exceptions import SuspiciousFileOperation
from django.core.files.storage import FileSystemStorage
from storages.utils import get_available_overwrite_name

from readthedocs.core.utils.filesystem import safe_open
from readthedocs.storage.rclone import RCloneLocal
Expand Down Expand Up @@ -47,16 +46,6 @@ def _dirpath(path):

return path

def get_available_name(self, name, max_length=None):
"""
Overrides Django's storage to always return the passed name (overwrite).

By default, Django will not overwrite files even if the same name is specified.
This changes that functionality so that the default is to use the same name and overwrite
rather than modify the path to not clobber files.
"""
return get_available_overwrite_name(name, max_length=max_length)

def delete_directory(self, path):
"""
Delete all files under a certain path from storage.
Expand Down
2 changes: 1 addition & 1 deletion requirements/deploy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ django-safemigrate==4.3
# via -r requirements/pip.txt
django-simple-history==3.0.0
# via -r requirements/pip.txt
django-storages[boto3]==1.14.3
django-storages[boto3]==1.14.4
# via -r requirements/pip.txt
django-structlog==2.2.0
# via -r requirements/pip.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/docker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ django-safemigrate==4.3
# via -r requirements/pip.txt
django-simple-history==3.0.0
# via -r requirements/pip.txt
django-storages[boto3]==1.14.3
django-storages[boto3]==1.14.4
# via -r requirements/pip.txt
django-structlog==2.2.0
# via -r requirements/pip.txt
Expand Down
5 changes: 1 addition & 4 deletions requirements/pip.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ django-cors-headers
# User agent parsing - used for analytics purposes
user-agents

# Pinned because we need to remove the usage of
# `get_available_overwrite_name` first
# See https://github.com/readthedocs/readthedocs.org/pull/11505
django-storages[boto3]==1.14.3
django-storages[boto3]


# Required only in development and linting
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ django-safemigrate==4.3
# via -r requirements/pip.in
django-simple-history==3.0.0
# via -r requirements/pip.in
django-storages[boto3]==1.14.3
django-storages[boto3]==1.14.4
# via -r requirements/pip.in
django-structlog==2.2.0
# via -r requirements/pip.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ django-safemigrate==4.3
# via -r requirements/pip.txt
django-simple-history==3.0.0
# via -r requirements/pip.txt
django-storages[boto3]==1.14.3
django-storages[boto3]==1.14.4
# via -r requirements/pip.txt
django-structlog==2.2.0
# via -r requirements/pip.txt
Expand Down