mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Revert "increase to 10 chars for good measure"
This reverts commit 941230671c.
This commit is contained in:
@@ -64,7 +64,7 @@ module ProjectIdentifiers
|
||||
def handle_update_failure(classic_id, error)
|
||||
Rails.logger.warn "#{self.class}: Could not set identifier '#{classic_id}' for project #{project.id}; " \
|
||||
"falling back to a randomized suffix. (#{error.message})"
|
||||
project.update!(identifier: "project-#{SecureRandom.alphanumeric(10).downcase}")
|
||||
project.update!(identifier: "project-#{SecureRandom.alphanumeric(5).downcase}")
|
||||
end
|
||||
|
||||
def identifier_generator
|
||||
|
||||
@@ -132,7 +132,7 @@ RSpec.describe ProjectIdentifiers::RevertProjectToClassicService do
|
||||
|
||||
it "assigns a project-NNNNN fallback identifier" do
|
||||
described_class.new(project).call
|
||||
expect(project.reload.identifier).to match(/\Aproject-[a-z0-9]{10}\z/)
|
||||
expect(project.reload.identifier).to match(/\Aproject-[a-z0-9]{5}\z/)
|
||||
end
|
||||
|
||||
it "logs a warning containing the project id and the conflicting identifier" do
|
||||
|
||||
@@ -156,7 +156,7 @@ RSpec.describe ProjectIdentifiers::RevertInstanceToClassicIdsJob do
|
||||
end
|
||||
|
||||
it "assigns project_conflict a project-NNNNN fallback identifier" do
|
||||
expect(project_conflict.reload.identifier).to match(/\Aproject-[a-z0-9]{10}\z/)
|
||||
expect(project_conflict.reload.identifier).to match(/\Aproject-[a-z0-9]{5}\z/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user