What would the syntax look like to change a user’s username via the console?
@riking did that for me here on this forum (meta discourse) and changed my username from ftudor to just frank…and I am 85% sure he SSH’d in and ran something through Redis (I believe) in the Docker bubble. I have seen simpler way to do one-off SQL database changes from @sam both of the approaches/examples were on a different discourse forum so I won’t link those here. And I cant find a good example to link to on meta.d so perhaps they could chime in?
admins can change usernames unrestricted.
you may need to clean up leftover mentions manually, but that is really an expert mode thing.
@sam Thanks man, is it possible to have 2 character user names? I’d like to use my initials, but even after changing the “min_username_length” to 2 and rebuilding the app I still get an error when I try to change it on my profile page.
Change username via the console will allow you to bypass the JS check.
rails c u = User.find_by(:username => "old_username") u.username = "new_username" u.save
The minimum length is hard coded on the JS side.
JS check should have parity with what the server enforces. This looks like a bug.
2 letter usernames are not supported really, but a PR to cleanly allow this is fine.
The Rails code you presented at the top worked like a charm. Much thanks again.