Rubocop
This commit is contained in:
parent
1219518268
commit
5262fdcf10
@ -145,7 +145,7 @@ class DmsfFile < ApplicationRecord
|
|||||||
|
|
||||||
def delete(commit: false)
|
def delete(commit: false)
|
||||||
if locked_for_user? && !User.current.allowed_to?(:force_file_unlock, project)
|
if locked_for_user? && !User.current.allowed_to?(:force_file_unlock, project)
|
||||||
Rails.logger.info { l(:error_file_is_locked) }
|
Rails.logger.info l(:error_file_is_locked)
|
||||||
if lock.reverse[0].user
|
if lock.reverse[0].user
|
||||||
errors.add(:base, l(:title_locked_by_user, user: lock.reverse[0].user))
|
errors.add(:base, l(:title_locked_by_user, user: lock.reverse[0].user))
|
||||||
else
|
else
|
||||||
|
|||||||
@ -38,9 +38,7 @@ module RedmineDmsf
|
|||||||
rescue StandardError
|
rescue StandardError
|
||||||
@office_available = false
|
@office_available = false
|
||||||
end
|
end
|
||||||
unless @office_available
|
Rails.logger.warn l(:note_dmsf_office_bin_not_available, value: OFFICE_BIN, locale: :en) unless @office_available
|
||||||
Rails.logger.warn { l(:note_dmsf_office_bin_not_available, value: OFFICE_BIN, locale: :en) }
|
|
||||||
end
|
|
||||||
@office_available
|
@office_available
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -548,7 +548,7 @@ module RedmineDmsf
|
|||||||
pattern = Setting.plugin_redmine_dmsf['dmsf_webdav_ignore']
|
pattern = Setting.plugin_redmine_dmsf['dmsf_webdav_ignore']
|
||||||
pattern = /^(\._|\.DS_Store$|Thumbs.db$)/ if pattern.blank?
|
pattern = /^(\._|\.DS_Store$|Thumbs.db$)/ if pattern.blank?
|
||||||
if basename.match(pattern)
|
if basename.match(pattern)
|
||||||
Rails.logger.info { "#{basename} ignored" }
|
Rails.logger.info "#{basename} ignored"
|
||||||
return NoContent
|
return NoContent
|
||||||
end
|
end
|
||||||
reuse_revision = false
|
reuse_revision = false
|
||||||
@ -557,7 +557,7 @@ module RedmineDmsf
|
|||||||
# Disable versioning for file name patterns given in the plugin settings.
|
# Disable versioning for file name patterns given in the plugin settings.
|
||||||
pattern = Setting.plugin_redmine_dmsf['dmsf_webdav_disable_versioning']
|
pattern = Setting.plugin_redmine_dmsf['dmsf_webdav_disable_versioning']
|
||||||
if pattern.present? && basename.match(pattern)
|
if pattern.present? && basename.match(pattern)
|
||||||
Rails.logger.info { "Versioning disabled for #{basename}" }
|
Rails.logger.info "Versioning disabled for #{basename}"
|
||||||
reuse_revision = true
|
reuse_revision = true
|
||||||
end
|
end
|
||||||
reuse_revision = true if reuse_version_for_locked_file(file)
|
reuse_revision = true if reuse_version_for_locked_file(file)
|
||||||
@ -617,7 +617,7 @@ module RedmineDmsf
|
|||||||
# Ignore 1b files sent for authentication
|
# Ignore 1b files sent for authentication
|
||||||
if Setting.plugin_redmine_dmsf['dmsf_webdav_ignore_1b_file_for_authentication'].present? &&
|
if Setting.plugin_redmine_dmsf['dmsf_webdav_ignore_1b_file_for_authentication'].present? &&
|
||||||
new_revision.size == 1
|
new_revision.size == 1
|
||||||
Rails.logger.warn { "1b file '#{basename}' sent for authentication ignored" }
|
Rails.logger.warn "1b file '#{basename}' sent for authentication ignored"
|
||||||
return NoContent
|
return NoContent
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user