diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-14 16:19:58 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-14 16:19:58 +0200 |
| commit | 9cb80356fc4cff7b8ecda91877755d6e361667c4 (patch) | |
| tree | c983be901aed9fe128986d5d749b9a91f17d536f | |
| parent | c35501a1280e02638c0e5bf2530cb48e15a68ad0 (diff) | |
[py3] Fed strftime with unicode on Python 3
| -rw-r--r-- | django/db/models/fields/files.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py index ad4c36ca0d..adb9c16fed 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_bytes +from django.utils.encoding import force_text, smart_str 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_bytes(self.upload_to)))) + return os.path.normpath(force_text(datetime.datetime.now().strftime(smart_str(self.upload_to)))) def get_filename(self, filename): return os.path.normpath(self.storage.get_valid_name(os.path.basename(filename))) |
