Locking of inexistent files fails #292

This commit is contained in:
Karel Pičman 2014-10-16 14:54:18 +02:00
parent 4f564abd2a
commit 2031b3fd3c

View File

@ -397,7 +397,7 @@ module RedmineDmsf
end
# Lock Check
# Check for the existance of locks
# Check for the existence of locks
# At present as deletions of folders are not recursive, we do not need to extend
# this to cover every file, just queried
def lock_check(lock_scope=nil)
@ -410,8 +410,9 @@ module RedmineDmsf
# Lock
def lock(args)
return Conflict unless (parent.projectless_path == "/" || parent_exists?)
lock_check(args[:scope])
return Conflict unless (parent.projectless_path == '/' || parent_exists?)
lock_check(args[:scope])
raise DAV4Rack::LockFailure.new("Path does't exist: #{@path}") unless exists?
entity = file? ? file : folder
begin
if (entity.locked? && entity.locked_for_user?)