当我等待将合并请求引入 Gitlab 以避免此问题时,我需要一种解决方法来通过 gitlab-rails 控制台编辑用户的电子邮件地址。
使用这个:
user = User.find_by(name: 'test')
user.email = '[email protected] /cdn-cgi/l/email-protection'
user.save
允许编辑用户,但要求我在应用新电子邮件之前确认。任何想法?
我后来发现了它,所以万一有人遇到同样的问题:
gitlab-rails runner '
user = User.find_by(name: 'test')
user.email = '[email protected] /cdn-cgi/l/email-protection'
user.skip_reconfirmation!
user.save
'
编辑:这曾经在旧版本中工作,但不再需要,因为我在使用 Users API 时添加了跳过确认:https://docs.gitlab.com/ee/api/users.html#add-email-for-user https://docs.gitlab.com/ee/api/users.html#add-email-for-user
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)