From 1e08861c5fcbcd446d8013c6fe6a1e06d7adc0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20B=C3=BCrgi?= Date: Tue, 24 Sep 2024 17:29:53 +0200 Subject: [PATCH] replace force_text with force_str to enable compatibility with current django https://stackoverflow.com/questions/70382084/import-error-force-text-from-django-utils-encoding --- django_hashedfilenamestorage/storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_hashedfilenamestorage/storage.py b/django_hashedfilenamestorage/storage.py index a2ec4ea..d5cd8be 100644 --- a/django_hashedfilenamestorage/storage.py +++ b/django_hashedfilenamestorage/storage.py @@ -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 @@ -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)