mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
[api] Fix bug in set repo passwod
This commit is contained in:
@@ -594,17 +594,7 @@ def check_set_repo_password(request, repo):
|
|||||||
if not check_permission(repo.id, request.user.username):
|
if not check_permission(repo.id, request.user.username):
|
||||||
return api_error(status.HTTP_403_FORBIDDEN, 'Forbid to access this repo.')
|
return api_error(status.HTTP_403_FORBIDDEN, 'Forbid to access this repo.')
|
||||||
|
|
||||||
password_set = False
|
|
||||||
if repo.encrypted:
|
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)
|
password = request.REQUEST.get('password', default=None)
|
||||||
if not password:
|
if not password:
|
||||||
return api_error(HTTP_440_REPO_PASSWD_REQUIRED,
|
return api_error(HTTP_440_REPO_PASSWD_REQUIRED,
|
||||||
|
Reference in New Issue
Block a user