Commit a84005e2 authored by Michael Friedrich's avatar Michael Friedrich Committed by Brian Williams

Update username error message to specify 'reserved file extension'

parent 6c981091
......@@ -2096,7 +2096,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
......
......@@ -39876,7 +39876,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