Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace force_text with force_str to enable compatibility with Django>=4 #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions django_hashedfilenamestorage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.core.files import File
from django.core.files.storage import FileSystemStorage
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from django.core.exceptions import ImproperlyConfigured


Expand Down Expand Up @@ -57,7 +57,7 @@ def save(self, name, content, max_length=None):
name = self._save(name, content)

# Store filenames with forward slashes, even on Windows
return force_text(name.replace('\\', '/'))
return force_str(name.replace('\\', '/'))

def _save(self, name, content, *args, **kwargs):
name = self._get_content_name(name=name, content=content)
Expand Down