FIX: wizard was not showing up if more than 1 system user

This commit is contained in:
Sam 2017-05-23 11:09:50 -04:00
parent 80af54460a
commit 35bb4ae995
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# Some sanity checking so we don't count on an unindexed column on boot
if User.limit(20).count < 20 && User.where(admin: true).count == 1
if User.limit(20).count < 20 && User.where(admin: true).human_users.count == 0
notice =
if GlobalSetting.developer_emails.blank?
"Congratulations, you installed Discourse! Unfortunately, no administrator emails were defined during setup, so finalizing the configuration <a href='https://meta.discourse.org/t/how-to-create-an-administrator-account-after-install/14046'>may be difficult</a>."

View File

@ -87,7 +87,7 @@ class Wizard
end
first_admin_id = User.where(admin: true)
.where.not(id: Discourse.system_user.id)
.human_users
.joins(:user_auth_tokens)
.order('user_auth_tokens.created_at')
.pluck(:id).first