Skip to content

Commit 9b60722

Browse files
committed
Dependencies: don't override get_available_name (Django Storages)
The fuction `get_available_overwrite_name` was removed. There is a setting `file_overwrite` which is set to `True` by default and our override shouldn't be required anymore. https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings Related: #11502
1 parent 61b9f19 commit 9b60722

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

readthedocs/builds/storage.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
)
99
from django.core.exceptions import SuspiciousFileOperation
1010
from django.core.files.storage import FileSystemStorage
11-
from storages.utils import get_available_overwrite_name
1211

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

4847
return path
4948

50-
def get_available_name(self, name, max_length=None):
51-
"""
52-
Overrides Django's storage to always return the passed name (overwrite).
53-
54-
By default, Django will not overwrite files even if the same name is specified.
55-
This changes that functionality so that the default is to use the same name and overwrite
56-
rather than modify the path to not clobber files.
57-
"""
58-
return get_available_overwrite_name(name, max_length=max_length)
59-
6049
def delete_directory(self, path):
6150
"""
6251
Delete all files under a certain path from storage.

0 commit comments

Comments
 (0)