# Username change logging even if it failed

**URL:** https://meta.discourse.org/t/username-change-logging-even-if-it-failed/117469
**Category:** Bug
**Created:** [May 11, 2019, 3:31pm UTC](https://meta.discourse.org/t/username-change-logging-even-if-it-failed/117469 "2019-05-11T15:31:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Zeemah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zeemah/32/252179_2.png) [@Zeemah](https://meta.discourse.org/u/Zeemah)
#### Post date: [May 11, 2019, 3:31pm UTC](https://meta.discourse.org/t/username-change-logging-even-if-it-failed/117469/1 "2019-05-11T15:31:19Z")

</div>

This isn’t any serious bug as the username still does not change, however it is a little inconvenient for moderators when viewing action logs for a specific user and they see a username change but it hasn’t _actually_ been changed.

1. Go to `/u/[username]/preferences/username`.
2. Attempt to change the username to something that is already taken.
3. Press the ‘change’ box when it allows you to.
  - This was a bit hard for me, I will assume this will have different outputs and timings in different environments.

 ![These-Extroverted-Altruistic](https://global.discourse-cdn.com/meta/original/3X/9/3/93cf921f655a899efcb4b938fc8840076802a5c7.gif)

Despite the username not changing, it still logs in `admin/logs/staff_action_logs` as the username being successfully changed:  
 ![04%2028PM](https://global.discourse-cdn.com/meta/original/3X/9/8/98a25837ffaafa208661a53427ccbe301b83def4.png)

Just thought I would report it 😃

Thanks.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 11, 2019, 9:00pm UTC](https://meta.discourse.org/t/username-change-logging-even-if-it-failed/117469/2 "2019-05-11T21:00:06Z")

</div>

This seems like a bug @techAPJ?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [May 13, 2019, 4:51pm UTC](https://meta.discourse.org/t/username-change-logging-even-if-it-failed/117469/4 "2019-05-13T16:51:21Z")

</div>

Fixed in:

[https://github.com/discourse/discourse/commit/a2b1789c3e3590e354edc0b0c14886955d0d2388](https://github.com/discourse/discourse/commit/a2b1789c3e3590e354edc0b0c14886955d0d2388)

Thanks for reporting this issue @Zeemah 👍

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [May 13, 2019, 4:51pm UTC](https://meta.discourse.org/t/username-change-logging-even-if-it-failed/117469/5 "2019-05-13T16:51:25Z")

</div>


