summaryrefslogtreecommitdiff
path: root/django/db/models/fields/files.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-08-29 22:40:51 +0200
committerClaude Paroz <claude@2xlibre.net>2012-08-30 15:46:16 +0200
commitae88e73fa630694a152b54df68d53ce535312e45 (patch)
treee1eda66e1ccb36c9b66504d565a2cfcb856ed926 /django/db/models/fields/files.py
parent36df198e4b2f03102389e6e8aa08365c0d0bd974 (diff)
downloaddjango-ae88e73fa630694a152b54df68d53ce535312e45.tar.gz
Replaced some smart_xxx by force_xxx equivalent
smart_str/smart_text should only be used when a potential lazy string should be preserved in the result of the function call.
Diffstat (limited to 'django/db/models/fields/files.py')
-rw-r--r--django/db/models/fields/files.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
index adb9c16fed..f16632ef25 100644
--- a/django/db/models/fields/files.py
+++ b/django/db/models/fields/files.py
@@ -8,7 +8,7 @@ from django.core.files.base import File
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
-from django.utils.encoding import force_text, smart_str
+from django.utils.encoding import force_str, force_text
from django.utils import six
from django.utils.translation import ugettext_lazy as _
@@ -280,7 +280,7 @@ class FileField(Field):
setattr(cls, self.name, self.descriptor_class(self))
def get_directory_name(self):
- return os.path.normpath(force_text(datetime.datetime.now().strftime(smart_str(self.upload_to))))
+ return os.path.normpath(force_text(datetime.datetime.now().strftime(force_str(self.upload_to))))
def get_filename(self, filename):
return os.path.normpath(self.storage.get_valid_name(os.path.basename(filename)))