discourse: Make sure the notification email setting applies

Discourse normally overrides the default notification email setting,
which makes the `notificationEmailAddress` setting ineffective. Add a
patch to remove this override.

Fixes #140114.
This commit is contained in:
talyz 2021-10-01 11:03:47 +02:00
parent 378d2c5dce
commit 917a0cfe47
No known key found for this signature in database
GPG key ID: 2DED2151F4671A2B
2 changed files with 21 additions and 0 deletions

View file

@ -263,6 +263,9 @@ let
# defaults to the plugin's directory and isn't writable at the
# time of asset generation
./auto_generated_path.patch
# Make sure the notification email setting applies
./notification_email.patch
];
postPatch = ''

View file

@ -0,0 +1,18 @@
diff --git a/db/fixtures/990_settings.rb b/db/fixtures/990_settings.rb
deleted file mode 100644
index 6f21e58813..0000000000
--- a/db/fixtures/990_settings.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# 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