Skip to content

Commit

Permalink
fixed some unicode issues with .url_full property of FileObject()
Browse files Browse the repository at this point in the history
git-svn-id: http://django-filebrowser.googlecode.com/svn/trunk@592 b1eb0509-c838-0410-b15c-e5ce2c1b85ca
  • Loading branch information
klemens.mantzos committed Jun 4, 2010
1 parent 6ec8af6 commit 95fa7bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion filebrowser/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# filebrowser imports
from filebrowser.settings import *
from filebrowser.functions import get_file_type, url_join, is_selectable, get_version_path
from django.utils.encoding import force_unicode

# PIL import
if STRICT_PIL:
Expand Down Expand Up @@ -106,7 +107,7 @@ def _url_full(self):
"""
Full URL including MEDIA_URL.
"""
return u"%s" % url_join(MEDIA_URL, self.url_rel)
return force_unicode(url_join(MEDIA_URL, self.url_rel))
url_full = property(_url_full)

def _url_save(self):
Expand Down
2 changes: 1 addition & 1 deletion filebrowser/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def url_join(*args):
else:
url = "/"
for arg in args:
arg = unicode(arg).replace("\\", "/")
arg = arg.replace("\\", "/")
arg_split = arg.split("/")
for elem in arg_split:
if elem != "" and elem != "http:":
Expand Down
3 changes: 1 addition & 2 deletions filebrowser/templatetags/fb_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
# django imports
from django.template import Library, Node, Variable, VariableDoesNotExist, TemplateSyntaxError
from django.conf import settings
from django.utils.encoding import force_unicode
from django.utils.encoding import smart_str
from django.utils.encoding import force_unicode, smart_str

# filebrowser imports
from filebrowser.settings import MEDIA_ROOT, MEDIA_URL, VERSIONS
Expand Down

0 comments on commit 95fa7bb

Please sign in to comment.