Skip to content

Commit 0cfdb56

Browse files
ysksnhiyuki2578
authored andcommitted
Not to create an account if already exist (mastodon#11366)
1 parent d672b79 commit 0cfdb56

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

db/seeds.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Doorkeeper::Application.create!(name: 'Web', superapp: true, redirect_uri: Doorkeeper.configuration.native_redirect_uri, scopes: 'read write follow')
22

33
domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain
4-
Account.create!(id: -99, actor_type: 'Application', locked: true, username: domain)
4+
account = Account.find_or_initialize_by(id: -99, actor_type: 'Application', locked: true, username: domain)
5+
account.save!
56

67
if Rails.env.development?
78
admin = Account.where(username: 'admin').first_or_initialize(username: 'admin')

0 commit comments

Comments
 (0)