New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix username validation message to match regexp. #7204

Merged
merged 1 commit into from Jul 2, 2014

Conversation

6 participants
@cirosantilli
Contributor

cirosantilli commented Jun 26, 2014

Fix https://github.com/gitlabhq/gitlabhq/issues/7199

Also correct the analogous problem for project, group names and web UI file creation.

Touches only user interface error message: behavior is unchanged.

@TeatroIO

This comment has been minimized.

TeatroIO commented Jun 26, 2014

I've prepared a stage. Click to open.

@@ -120,7 +120,8 @@ class User < ActiveRecord::Base
validates :username, presence: true, uniqueness: { case_sensitive: false },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.username_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
message: "username not allowed. Must match: " \

This comment has been minimized.

@houndci-bot

houndci-bot Jun 26, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

format: { with: Gitlab::Regex.username_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
format: {

This comment has been minimized.

@houndci-bot

houndci-bot Jun 26, 2014

Align the elements of a hash literal if they span more than one line.

format: { with: Gitlab::Regex.username_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
format: {

This comment has been minimized.

@houndci-bot

houndci-bot Jun 26, 2014

Align the elements of a hash literal if they span more than one line.

message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
validates :username,
presence: true, uniqueness: { case_sensitive: false },

This comment has been minimized.

@houndci-bot

houndci-bot Jun 26, 2014

Align the parameters of a method call if they span more than one line.

@cirosantilli cirosantilli changed the title from Fix username validation message to match regexp. to [WIP] Fix username validation message to match regexp. Jun 26, 2014

@cirosantilli cirosantilli changed the title from [WIP] Fix username validation message to match regexp. to Fix username validation message to match regexp. Jun 26, 2014

@cirosantilli cirosantilli changed the title from Fix username validation message to match regexp. to [WIP] Fix username validation message to match regexp. Jun 26, 2014

Fix username validation message to match regexp.
Also used for project, group and web ui new file names.

@cirosantilli cirosantilli changed the title from [WIP] Fix username validation message to match regexp. to Fix username validation message to match regexp. Jun 26, 2014

@dosire

This comment has been minimized.

Member

dosire commented Jun 26, 2014

@randx 👍 from me

dzaporozhets added a commit that referenced this pull request Jul 2, 2014

Merge pull request #7204 from cirosantilli/user-validation-msg
Fix username validation message to match regexp.

@dzaporozhets dzaporozhets merged commit d35a99e into gitlabhq:master Jul 2, 2014

1 check failed

continuous-integration/travis-ci The Travis CI build could not complete due to an error
Details
@dzaporozhets

This comment has been minimized.

Member

dzaporozhets commented Jul 2, 2014

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment