mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 19:03:49 +08:00
8b2e7483b2
In development and test mode you don't care about email domains. Now that `rake db:migrate` outputs a lot less this felt like an error when it's really a warning.
13 lines
456 B
Ruby
13 lines
456 B
Ruby
# frozen_string_literal: true
|
|
|
|
if SiteSetting.notification_email == SiteSetting.defaults[:notification_email]
|
|
# don't crash for invalid hostname, which is possible in dev
|
|
begin
|
|
SiteSetting.notification_email = "noreply@#{Discourse.current_hostname}"
|
|
rescue Discourse::InvalidParameters
|
|
if Rails.env.production?
|
|
STDERR.puts "WARNING: Discourse hostname: #{Discourse.current_hostname} is not a valid domain for emails!"
|
|
end
|
|
end
|
|
end
|