sehmaschine/django-filebrowser — pull request #237 by ikks (2014-08-19 15:17:48+00:00)
Title: Fixed renaming UTF-8  problems

When we had a filename with nonascii characters and when we were renaming the file it went broken giving a traceback like the following. We fix that problem with this patch on the string_to_dict helper function.

Traceback:

File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/filebrowser/decorators.py" in decorator
65. return function(request, *args, **kwargs)
File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/filebrowser/decorators.py" in decorator
45. return function(request, *args, **kwargs)
File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/django/contrib/admin/views/decorators.py" in _checklogin
17. return view_func(request, *args, **kwargs)
File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
52. response = view_func(request, *args, **kwargs)
File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/filebrowser/sites.py" in detail
493. redirect_url = reverse("filebrowser:fb_detail", current_app=self.name) + query_helper(query, "filename="+new_name, "filename")
File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/filebrowser/templatetags/fb_tags.py" in query_helper
39. add = string_to_dict(add)
File "/Users/igortamara/.virtualenvs/co_web/lib/python2.7/site-packages/filebrowser/templatetags/fb_tags.py" in string_to_dict
77. string = str(string)

Exception Type: UnicodeEncodeError at /admin/filebrowser/detail/
Exception Value: 'ascii' codec can't encode character u'\xf3' in position 26: ordinal not in range(128)