While I am waiting for a merge request to be introduced to Gitlab to avoid this problem I need a workaround to edit an user's email address via the gitlab-rails console.
Using this:
user = User.find_by(name: 'test')
user.email = '[email protected]'
user.save
allows to edit the user but I am asked to confirm the new email before it is applied. Any idea?
I found it afterwards, so in case someone has the same problem:
gitlab-rails runner '
user = User.find_by(name: 'test')
user.email = '[email protected]'
user.skip_reconfirmation!
user.save
'
EDIT: This used to work in old version, but is no longer required as I contributed to add a skip confirmation when using the Users API: https://docs.gitlab.com/ee/api/users.html#add-email-for-user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With