Skip to content

Commit

Permalink
AzureStorage as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier committed Aug 30, 2018
1 parent 59ff135 commit 81e86ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions storages/backends/azure_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_bytes, force_text

from storages.utils import clean_name, safe_join, setting
from storages.utils import (
clean_name, get_available_overwrite_name, safe_join, setting,
)


@deconstructible
Expand Down Expand Up @@ -190,10 +192,10 @@ def get_available_name(self, name, max_length=_AZURE_NAME_MAX_LEN):
Returns a filename that's free on the target storage system, and
available for new content to be written to.
"""
name = self.get_valid_name(name)
if self.overwrite_files:
return self.get_valid_name(name)
return super(AzureStorage, self).get_available_name(
self.get_valid_name(name), max_length)
return get_available_overwrite_name(name, max_length)
return super(AzureStorage, self).get_available_name(name, max_length)

def exists(self, name):
return self.service.exists(
Expand Down

0 comments on commit 81e86ba

Please sign in to comment.