fix: remove hard-coded overwrite_files in AzureStorage #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
overwrite_files
is False by default in django-storages, and we so far hardcoded it toTrue
. However, users should be able to change it to their liking from the django settings usingAZURE_OVERWRITE_FILES
.Removing this override keeps the default behaviour (
True
), while still allowing users to change it.NOTE: I stumbled upon this limitation because django-storages changed the semantics of the
.exists()
function in their latest release, which now returns whether a path is free for upload (and not whether the file already exists on the remote storage). Withoverwrite_files
set to True,.exists()
will now always return False. It seems they are aware of the counter-intuitiveness of this change and will rollback soon.See jschneier/django-storages#1430