1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

Using urllib to quote repo_name instead of using django

This commit is contained in:
xiez
2012-04-25 17:25:08 +08:00
parent a7ac3f014d
commit 5f90b28a77

View File

@@ -8,7 +8,6 @@ from auth.models import User
from django.views.decorators.csrf import csrf_protect from django.views.decorators.csrf import csrf_protect
from auth.forms import AuthenticationForm, PasswordResetForm, SetPasswordForm, PasswordChangeForm from auth.forms import AuthenticationForm, PasswordResetForm, SetPasswordForm, PasswordChangeForm
from auth.tokens import default_token_generator from auth.tokens import default_token_generator
from django.utils.http import urlquote
from seaserv import cclient, ccnet_rpc, get_groups, get_users, get_repos, \ from seaserv import cclient, ccnet_rpc, get_groups, get_users, get_repos, \
get_repo, get_commits, get_branches, \ get_repo, get_commits, get_branches, \
@@ -18,6 +17,7 @@ from seahub.share.models import GroupShare, UserShare
from seahub.share.forms import GroupAddRepoForm from seahub.share.forms import GroupAddRepoForm
from seahub.base.accounts import CcnetUser from seahub.base.accounts import CcnetUser
from forms import AddUserForm from forms import AddUserForm
from urllib import quote
import stat import stat
import time import time
@@ -393,12 +393,12 @@ def repo_list_share(request):
def repo_download(request, repo_id): def repo_download(request, repo_id):
relay_id = cclient.props.id relay_id = cclient.props.id
repo_name = request.GET.get('repo_name') repo_name = request.GET.get('repo_name')
quote_repo_name = urlquote(repo_name) quote_repo_name = quote(repo_name)
encrypted = request.GET.get('enc') encrypted = request.GET.get('enc')
enc = '1' enc = '1'
if cmp(encrypted,'False') == 0: if cmp(encrypted,'False') == 0:
enc = '' enc = ''
assert False
ccnet_applet_root = get_ccnetapplet_root() ccnet_applet_root = get_ccnetapplet_root()
redirect_url = "%s/repo/download/?repo_id=%s&relay_id=%s&repo_name=%s&encrypted=%s" % ( redirect_url = "%s/repo/download/?repo_id=%s&relay_id=%s&repo_name=%s&encrypted=%s" % (
ccnet_applet_root, repo_id, relay_id, quote_repo_name, enc) ccnet_applet_root, repo_id, relay_id, quote_repo_name, enc)