mirror of
https://github.com/funamitech/mastodon
synced 2024-11-27 22:38:42 +09:00
Fix mastodon:setup not setting the admin's role properly (#19670)
* Fix mastodon:setup not setting the admin's role properly * Set contact username when creating admin account in mastodon:setup
This commit is contained in:
parent
cb27d89997
commit
e91418436a
@ -433,9 +433,12 @@ namespace :mastodon do
|
||||
|
||||
password = SecureRandom.hex(16)
|
||||
|
||||
user = User.new(admin: true, email: email, password: password, confirmed_at: Time.now.utc, account_attributes: { username: username }, bypass_invite_request_check: true)
|
||||
owner_role = UserRole.find_by(name: 'Owner')
|
||||
user = User.new(email: email, password: password, confirmed_at: Time.now.utc, account_attributes: { username: username }, bypass_invite_request_check: true, role: owner_role)
|
||||
user.save(validate: false)
|
||||
|
||||
Setting.site_contact_username = username
|
||||
|
||||
prompt.ok "You can login with the password: #{password}"
|
||||
prompt.warn 'You can change your password once you login.'
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user