about summary refs log tree commit diff
path: root/lib/tasks/mastodon.rake
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-06 18:49:46 +0100
committerGitHub <noreply@github.com>2022-11-06 18:49:46 +0100
commit54101563bbadbfafd9291a867d7fbea6df3a8b7b (patch)
treefcf9a125f6ebc3ad4182fa0edcbd7101b33aebb0 /lib/tasks/mastodon.rake
parent2f8fb49d1314db931385089bc9004a48700161ad (diff)
parent21d6bc16893a9dd24c5ef54cf2f554846c8eca5b (diff)
Merge pull request #1892 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'lib/tasks/mastodon.rake')
-rw-r--r--lib/tasks/mastodon.rake5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index 0ccfc9f29..80e1dcf52 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -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