Fix admin account created by mastodon:setup not being auto-approved (#29379)

This commit is contained in:
Claire 2024-02-23 20:04:57 +01:00 committed by GitHub
parent 25ffe0af45
commit cfa71a4d16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -544,6 +544,7 @@ namespace :mastodon do
owner_role = UserRole.find_by(name: 'Owner') 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 = 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) user.save(validate: false)
user.approve!
Setting.site_contact_username = username Setting.site_contact_username = username