提交 79b0bf2a 编写于 作者: D Douwe Maan

Merge branch '60278-fix-development-seed' into 'master'

Fix ApplicationSetting development seed

Closes #60278

See merge request gitlab-org/gitlab-ce!27213
......@@ -259,7 +259,9 @@ class ApplicationSetting < ApplicationRecord
after_commit :expire_performance_bar_allowed_user_ids_cache, if: -> { previous_changes.key?('performance_bar_allowed_group_id') }
def self.create_from_defaults
super
transaction(requires_new: true) do
super
end
rescue ActiveRecord::RecordNotUnique
# We already have an ApplicationSetting record, so just return it.
current_without_cache
......
......@@ -159,8 +159,8 @@ module Projects
log_message << " Project ID: #{@project.id}" if @project&.id
Rails.logger.error(log_message)
if @project
@project.import_state.mark_as_failed(message) if @project.persisted? && @project.import?
if @project && @project.persisted? && @project.import_state
@project.import_state.mark_as_failed(message)
end
@project
......
# frozen_string_literal: true
puts "Creating the default ApplicationSetting record.".color(:green)
Gitlab::CurrentSettings.current_application_settings
ApplicationSetting.create_from_defaults
# Details https://gitlab.com/gitlab-org/gitlab-ce/issues/46241
puts "Enable hashed storage for every new projects.".color(:green)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册