FIX: Restoring backup shouldn't change disable_emails from "yes" to "non-staff"

FIX: Restoring backup shouldn’t change disable_emails from “yes” to “non-staff”

diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb
index 57870cf..f4f6612 100644
--- a/lib/backup_restore/restorer.rb
+++ b/lib/backup_restore/restorer.rb
@@ -403,7 +403,7 @@ module BackupRestore
       log "Reloading site settings..."
       SiteSetting.refresh!
 
-      if @disable_emails
+      if @disable_emails && SiteSetting.disable_emails == 'no'
         log "Disabling outgoing emails for non-staff users..."
         user = User.find_by_email(@user_info[:email]) || Discourse.system_user
         SiteSetting.set_and_log(:disable_emails, 'non-staff', user)

GitHub sha: 3aca0703

2 Likes

This commit has been mentioned on Discourse Meta. There might be relevant details there: