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

Conversation

humitos
Copy link
Member

@humitos humitos commented Jul 30, 2024

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

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
@humitos humitos marked this pull request as ready for review July 30, 2024 11:24
@humitos humitos requested a review from a team as a code owner July 30, 2024 11:24
@humitos humitos requested a review from stsewd July 30, 2024 11:24
@humitos
Copy link
Member Author

humitos commented Aug 12, 2024

@stsewd does this change look good for you?

@stsewd
Copy link
Member

stsewd commented Aug 12, 2024

Makes sense. Tests are broken.

@humitos
Copy link
Member Author

humitos commented Aug 13, 2024

It seems that it's not overriding the files but adding a suffix:

>       self.assertEqual(
            {result.path for result in results},
            {"index.html", "404.html", "test.html", "api/index.html"},
        )
E       AssertionError: Items in the first set but not the second:
E       'index_ISlyKDd.html'
E       'test_EzpP2AY.html'
E       '404_nNCfKDs.html'
E       'index_Iha4OsZ.html'
E       '404_QBsoCyP.html'
E       '404_2qHEqDO.html'
E       'test_NAXp5j8.html'
E       Items in the second set but not the first:
E       'api/index.html'

In theory, it should behave like that by default in the newer version, but 🤷🏼

@humitos
Copy link
Member Author

humitos commented Aug 13, 2024

OK, it's seems the problem here is a combination of things between django-storages and Django itself. There is a long conversation at jschneier/django-storages#1430. I will block this PR for now and keep an eye on that conversation for now.

@humitos humitos added the Status: blocked Issue is blocked on another issue label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: blocked Issue is blocked on another issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants