Commit f1e04955 authored by Fatih Acet's avatar Fatih Acet

Merge branch '23813-fix-username-character-validation-message' into 'master'

Properly escape username validation error

## What does this MR do?

Prevents the double-escaping of the username validation error when attempting to change one's username using an invalid character.

Go to [/profile/account]( and attempt to add an invalid character like `@` or `#` to your username to trigger this message.

## Screenshots (if relevant)

#### Before:

#### After:

## Does this MR meet the acceptance criteria?

- [ ] ~~[Changelog entry]( added~~
- [ ] ~~[Documentation created/updated](
- [ ] ~~API support added~~
- Tests
  - [ ] ~~Added for this feature/bug~~
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](
- [x] Conform by the [style guides](
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](

## What are the relevant issue numbers?

Closes #23813

See merge request !7725
parents c4799a2b 5b9c4f48
......@@ -2,5 +2,6 @@
new Flash("Username successfully changed", "notice")
- else
- error = @user.errors.full_messages.first
new Flash("Username change failed - #{@user.errors.full_messages.first}", "alert")
new Flash("Username change failed - #{escape_javascript error.html_safe}", "alert")
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment