From fcd51a67df5b5f323fc7918443ba8f3fca7b4b58 Mon Sep 17 00:00:00 2001 From: lian Date: Tue, 19 Apr 2016 15:44:23 +0800 Subject: [PATCH] rm "urllib2.quote" when reverse url --- seahub/views/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seahub/views/__init__.py b/seahub/views/__init__.py index 559193b666..c6e8043b02 100644 --- a/seahub/views/__init__.py +++ b/seahub/views/__init__.py @@ -743,11 +743,11 @@ def repo_revert_history(request, repo_id): def fpath_to_link(repo_id, path, is_dir=False): """Translate file path of a repo to its view link""" if is_dir: - href = reverse("view_common_lib_dir", args=[repo_id, urllib2.quote(path.encode('utf-8')).strip('/')]) + href = reverse("view_common_lib_dir", args=[repo_id, path.encode('utf-8').strip('/')]) else: if not path.startswith('/'): p = '/' + path - href = reverse("view_lib_file", args=[repo_id, urllib2.quote(p.encode('utf-8'))]) + href = reverse("view_lib_file", args=[repo_id, p.encode('utf-8')]) return '%s' % (href, escape(path)) @@ -1113,7 +1113,7 @@ def repo_revert_file(request, repo_id): msg = _(u'Successfully revert %(path)s to root directory.') % {"path": escape(path.lstrip('/')), "root": root_url} messages.success(request, msg, extra_tags='safe') else: - file_view_url = reverse('view_lib_file', args=[repo_id, urllib2.quote(path.encode('utf-8'))]) + file_view_url = reverse('view_lib_file', args=[repo_id, path.encode('utf-8')]) msg = _(u'Successfully revert %(path)s') % {"url": file_view_url, "path": escape(path.lstrip('/'))} messages.success(request, msg, extra_tags='safe') @@ -1152,7 +1152,7 @@ def repo_revert_dir(request, repo_id): msg = _(u'Successfully revert %(path)s to root directory.') % {"path": escape(path.lstrip('/')), "url": root_url} messages.success(request, msg, extra_tags='safe') else: - dir_view_url = reverse('view_common_lib_dir', args=[repo_id, urllib2.quote(path.strip('/').encode('utf-8'))]) + dir_view_url = reverse('view_common_lib_dir', args=[repo_id, path.strip('/').encode('utf-8')]) msg = _(u'Successfully revert %(path)s') % {"url": dir_view_url, "path": escape(path.lstrip('/'))} messages.success(request, msg, extra_tags='safe')