Skip to content

Commit

Permalink
Not to create an account if already exist (mastodon#11366)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysksn authored and hiyuki2578 committed Oct 2, 2019
1 parent d672b79 commit 0cfdb56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Doorkeeper::Application.create!(name: 'Web', superapp: true, redirect_uri: Doorkeeper.configuration.native_redirect_uri, scopes: 'read write follow')

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

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

0 comments on commit 0cfdb56

Please sign in to comment.