Commit 79b0bf2a authored by Douwe Maan's avatar Douwe Maan

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

Fix ApplicationSetting development seed

Closes #60278

See merge request gitlab-org/gitlab-ce!27213
parents 474f8dab 22c1c980
...@@ -259,7 +259,9 @@ class ApplicationSetting < ApplicationRecord ...@@ -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') } after_commit :expire_performance_bar_allowed_user_ids_cache, if: -> { previous_changes.key?('performance_bar_allowed_group_id') }
def self.create_from_defaults def self.create_from_defaults
transaction(requires_new: true) do
super super
end
rescue ActiveRecord::RecordNotUnique rescue ActiveRecord::RecordNotUnique
# We already have an ApplicationSetting record, so just return it. # We already have an ApplicationSetting record, so just return it.
current_without_cache current_without_cache
......
...@@ -159,8 +159,8 @@ module Projects ...@@ -159,8 +159,8 @@ module Projects
log_message << " Project ID: #{@project.id}" if @project&.id log_message << " Project ID: #{@project.id}" if @project&.id
Rails.logger.error(log_message) Rails.logger.error(log_message)
if @project if @project && @project.persisted? && @project.import_state
@project.import_state.mark_as_failed(message) if @project.persisted? && @project.import? @project.import_state.mark_as_failed(message)
end end
@project @project
......
# frozen_string_literal: true # frozen_string_literal: true
puts "Creating the default ApplicationSetting record.".color(:green) 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 # Details https://gitlab.com/gitlab-org/gitlab-ce/issues/46241
puts "Enable hashed storage for every new projects.".color(:green) puts "Enable hashed storage for every new projects.".color(:green)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment