mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Bypass registration checks for seeded admin user (#35565)
This commit is contained in:
parent
8d6f033326
commit
f1b9868980
1 changed files with 11 additions and 1 deletions
|
|
@ -7,7 +7,17 @@ if Rails.env.development?
|
|||
admin = Account.where(username: 'admin').first_or_initialize(username: 'admin')
|
||||
admin.save(validate: false)
|
||||
|
||||
user = User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, role: UserRole.find_by(name: 'Owner'), account: admin, agreement: true, approved: true)
|
||||
user = User.where(email: "admin@#{domain}").first_or_initialize(
|
||||
email: "admin@#{domain}",
|
||||
password: 'mastodonadmin',
|
||||
password_confirmation: 'mastodonadmin',
|
||||
confirmed_at: Time.now.utc,
|
||||
role: UserRole.find_by(name: 'Owner'),
|
||||
account: admin,
|
||||
agreement: true,
|
||||
approved: true,
|
||||
bypass_registration_checks: true
|
||||
)
|
||||
user.save!
|
||||
user.approve!
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue