Skip to content

Commit

Permalink
fix: remove hard-coded overwrite_files in AzureStorage
Browse files Browse the repository at this point in the history
The overwrite_files is True by default, and should be settable from the
django settings using AZURE_OVERWRITE_FILES.

Removing this override will keep the default behaviour (True), while
still allowing users to change it.

NOTE: this change is important because django / django-storages changed
the semantics of the .exists() function, which now returns whether a
path is free for upload (and not whether the file already exists on the
remote storage). With overwrite_files set to True, .exists() will now
always return False.

See jschneier/django-storages#1430
  • Loading branch information
derlin committed Jul 19, 2024
1 parent d8cd6a2 commit 8395a18
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion django_storage_url/backends/az.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def __init__(self, dsn):
self.azure_container = container_name
self.azure_ssl = secure_urls
self.max_memory_size = 10 * 1024**2
self.overwrite_files = True
self.location = ""
self.base_url = str(base_url)

Expand Down

0 comments on commit 8395a18

Please sign in to comment.