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

This commit is contained in:
Gerhard Schlager 2019-04-16 11:48:07 +02:00
parent ac27bdce14
commit 3aca070311
1 changed files with 1 additions and 1 deletions

View File

@ -403,7 +403,7 @@ module BackupRestore
log "Reloading site settings..." log "Reloading site settings..."
SiteSetting.refresh! SiteSetting.refresh!
if @disable_emails if @disable_emails && SiteSetting.disable_emails == 'no'
log "Disabling outgoing emails for non-staff users..." log "Disabling outgoing emails for non-staff users..."
user = User.find_by_email(@user_info[:email]) || Discourse.system_user user = User.find_by_email(@user_info[:email]) || Discourse.system_user
SiteSetting.set_and_log(:disable_emails, 'non-staff', user) SiteSetting.set_and_log(:disable_emails, 'non-staff', user)