Commit 0d62f390 authored by Jan Provaznik's avatar Jan Provaznik

Update error message of path conflict

Before transfering a group, it's checked if there is already Namespace
with the same path. Currently this effectively checks only if there is a
subgroup with the same path. If there is a project with the same path,
transfer fails too, but in the next step because updated group
validation fails with error `"Validation failed: Group URL has already
been taken"`.

When we create/backfill project namespace for each project, we will
effectively check both for subgroup or project path conflicts (because
project namespace will be created with the same path as project). So we
can just update the error message to mention that there is either group
or project with the same path.
parent 93fb6734
......@@ -191,7 +191,7 @@ module Groups
def localized_error_messages
{
database_not_supported: s_('TransferGroup|Database is not supported.'),
namespace_with_same_path: s_('TransferGroup|The parent group already has a subgroup with the same path.'),
namespace_with_same_path: s_('TransferGroup|The parent group already has a subgroup or a project with the same path.'),
group_is_already_root: s_('TransferGroup|Group is already a root group.'),
same_parent_as_current: s_('TransferGroup|Group is already associated to the parent group.'),
invalid_policies: s_("TransferGroup|You don't have enough permissions."),
......
......@@ -35927,7 +35927,7 @@ msgstr ""
msgid "TransferGroup|Group is already associated to the parent group."
msgstr ""
msgid "TransferGroup|The parent group already has a subgroup with the same path."
msgid "TransferGroup|The parent group already has a subgroup or a project with the same path."
msgstr ""
msgid "TransferGroup|Transfer failed: %{error_message}"
......
......@@ -153,7 +153,7 @@ RSpec.describe Groups::TransferService do
it 'adds an error on group' do
transfer_service.execute(nil)
expect(transfer_service.error).to eq('Transfer failed: The parent group already has a subgroup with the same path.')
expect(transfer_service.error).to eq('Transfer failed: The parent group already has a subgroup or a project with the same path.')
end
end
......@@ -241,7 +241,7 @@ RSpec.describe Groups::TransferService do
it 'adds an error on group' do
transfer_service.execute(new_parent_group)
expect(transfer_service.error).to eq('Transfer failed: The parent group already has a subgroup with the same path.')
expect(transfer_service.error).to eq('Transfer failed: The parent group already has a subgroup or a project with the same path.')
end
end
......
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