Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Force storage.file_overwrite to True #97

Closed
wants to merge 1 commit into from

Conversation

Gwildor
Copy link

@Gwildor Gwildor commented Feb 27, 2017

This fixes uploading a static file with the same name twice resulting in
a second file with a randomized suffix in the name, and of course the
first one never to be updated to the newer version.

This is a bit related to #30 and basically has the same fix. It's a bit
surprising that this never was a problem before, but that's probably
because, in contrary to the setting from #30, that default in
django-storages for this setting is the one we need. This also means
that the impact of this change is a lot smaller. It only affects
projects which have manually set this setting to False, most likely to
prevent user uploads from overwriting each other.

This fixes uploading a static file with the same name twice resulting in
a second file with a randomized suffix in the name, and of course the
first one never to be updated to the newer version.

This is a bit related to antonagestam#30 and basically has the same fix. It's a bit
surprising that this never was a problem before, but that's probably
because, in contrary to the setting from antonagestam#30, that default in
django-storages for this setting is the one we need. This also means
that the impact of this change is a lot smaller. It only affects
projects which have manually set this setting to False, most likely to
prevent user uploads from overwriting each other.
@antonagestam
Copy link
Owner

I'm reluctant to merging this, simply because I don't think it's a great thing to be overwriting user settings. I don't really see the value added, since if you deliberately add file_overwrite = False to your settings I don't see how you could be surprised by the behaviour that it creates.

Having Collectfast changing these settings means that maintaining and having stable releases becomes harder since more code depends on other libraries.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants