Commit de4610f8 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch 'username-file-extension-reserved-message' into 'master'

Update username error message to emphasize on 'reserved file extension'

See merge request gitlab-org/gitlab!70427
parents 4090646c a84005e2
......@@ -2098,7 +2098,7 @@ class User < ApplicationRecord
def check_username_format
return if username.blank? || Mime::EXTENSION_LOOKUP.keys.none? { |type| username.end_with?(".#{type}") }
errors.add(:username, _('ending with a file extension is not allowed.'))
errors.add(:username, _('ending with a reserved file extension is not allowed.'))
end
def groups_with_developer_maintainer_project_access
......
......@@ -39909,7 +39909,7 @@ msgstr ""
msgid "encrypted: needs to be a :required, :optional or :migrating!"
msgstr ""
msgid "ending with a file extension is not allowed."
msgid "ending with a reserved file extension is not allowed."
msgstr ""
msgid "entries cannot be larger than 255 characters"
......
......@@ -401,7 +401,7 @@ RSpec.describe User do
user = build(:user, username: "test.#{type}")
expect(user).not_to be_valid
expect(user.errors.full_messages).to include('Username ending with a file extension is not allowed.')
expect(user.errors.full_messages).to include('Username ending with a reserved file extension is not allowed.')
expect(build(:user, username: "test#{type}")).to be_valid
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