From: Ɓukasz Rekucki Date: Tue, 8 Sep 2009 11:08:18 +0000 (+0200) Subject: Patch to handle unicode image names. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/52666d1a087e978f58b9867558bf3fcbfdf04eee?ds=inline Patch to handle unicode image names. --- diff --git a/apps/explorer/models.py b/apps/explorer/models.py index 5fc31e7e..f292283f 100644 --- a/apps/explorer/models.py +++ b/apps/explorer/models.py @@ -48,7 +48,7 @@ def get_image_folders(): def get_images_from_folder(folder): - return sorted(settings.MEDIA_URL + settings.IMAGE_DIR + '/' + folder + '/' + fn for fn + return sorted(settings.MEDIA_URL + settings.IMAGE_DIR + u'/' + folder + u'/' + fn.decode('utf-8') for fn in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, folder)) - if not fn.startswith('.')) + if not fn.decode('utf-8').startswith('.'))