Skip to content
Snippets Groups Projects
storage.py 578 B
Newer Older
  • Learn to ignore specific revisions
  • 
    from django.core.files.storage import FileSystemStorage
    
    from storages.backends.s3boto3 import S3Boto3Storage
    
        """
        Convert unicode characters in name to ASCII characters.
        """
    
        return slugify.slugify(name, ok=slugify.SLUG_OK + ".", only_ascii=True)
    
    
    class ASCIIFileSystemStorage(FileSystemStorage):
        def get_valid_name(self, name):
            return super().get_valid_name(asciionly(name))
    
    
    Eliot Berriot's avatar
    Eliot Berriot committed
    
    
    class ASCIIS3Boto3Storage(S3Boto3Storage):
    
        def get_valid_name(self, name):
    
            return super().get_valid_name(asciionly(name))