2014-03-24 03:03:39 -04:00
# Some sanity checking so we don't count on an unindexed column on boot
2017-05-23 11:09:50 -04:00
if User . limit ( 20 ) . count < 20 && User . where ( admin : true ) . human_users . count == 0
2014-03-24 03:03:39 -04:00
notice =
if GlobalSetting . developer_emails . blank?
2014-03-24 03:33:02 -04:00
" 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>. "
2014-03-24 03:03:39 -04:00
else
emails = GlobalSetting . developer_emails . split ( " , " )
if emails . length > 1
2016-10-18 11:44:25 -04:00
emails = emails [ 0 .. - 2 ] . join ( ', ' ) << " or #{ emails [ - 1 ] } "
2014-03-24 18:45:21 -04:00
else
emails = emails [ 0 ]
2014-03-24 03:03:39 -04:00
end
2014-04-21 14:36:29 -04:00
" Congratulations, you installed Discourse! Register a new admin account with #{ emails } to finalize configuration. "
2014-03-24 03:03:39 -04:00
end
if notice != SiteSetting . global_notice
SiteSetting . global_notice = notice
SiteSetting . has_login_hint = true
end
2017-07-27 21:20:09 -04:00
# we may be booting with no User table eg: first migration, just skip
2014-03-24 03:03:39 -04:00
end rescue nil