mirror of
https://github.com/haiwen/seahub.git
synced 2025-05-11 17:34:56 +00:00
Fix api mkdir error when parent dir is nonexistent, and clean duplicated code in account
This commit is contained in:
parent
612abc605d
commit
8410afdba2
seahub
@ -2261,6 +2261,11 @@ class DirView(APIView):
|
||||
|
||||
create_parents = request.POST.get('create_parents', '').lower() in ('true', '1')
|
||||
if not create_parents:
|
||||
# check whether parent dir exists
|
||||
if not seafile_api.get_dir_id_by_path(repo_id, parent_dir):
|
||||
return api_error(status.HTTP_400_BAD_REQUEST,
|
||||
'Parent dir does not exist')
|
||||
|
||||
new_dir_name = os.path.basename(path)
|
||||
new_dir_name_utf8 = check_filename_with_rename_utf8(repo_id,
|
||||
parent_dir,
|
||||
|
@ -93,7 +93,6 @@ class UserManager(object):
|
||||
user.org = emailuser.org
|
||||
user.source = emailuser.source
|
||||
user.role = emailuser.role
|
||||
user.source = emailuser.source
|
||||
|
||||
return user
|
||||
|
||||
@ -293,7 +292,6 @@ class AuthBackend(object):
|
||||
user.org = emailuser.org
|
||||
user.source = emailuser.source
|
||||
user.role = emailuser.role
|
||||
user.source = emailuser.source
|
||||
|
||||
return user
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user