1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 23:29:49 +00:00

[api] Fix bug in set repo passwod

This commit is contained in:
zhengxie
2014-10-20 12:00:10 +08:00
parent 85053c0a2f
commit 549d1beab7

View File

@@ -594,17 +594,7 @@ def check_set_repo_password(request, repo):
if not check_permission(repo.id, request.user.username):
return api_error(status.HTTP_403_FORBIDDEN, 'Forbid to access this repo.')
password_set = False
if repo.encrypted:
try:
ret = seafile_api.is_password_set(repo.id, request.user.username)
if ret == 1:
password_set = True
except SearpcError, e:
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR,
"SearpcError:" + e.msg)
if not password_set:
password = request.REQUEST.get('password', default=None)
if not password:
return api_error(HTTP_440_REPO_PASSWD_REQUIRED,