Send notifications for backup/restore from system user
This commit is contained in:
parent
d23c7cdc65
commit
d0753ec7a5
|
@ -268,9 +268,9 @@ module Export
|
||||||
log "Notifying '#{@user.username}' of the end of the backup..."
|
log "Notifying '#{@user.username}' of the end of the backup..."
|
||||||
# NOTE: will only notify if @user != Discourse.site_contact_user
|
# NOTE: will only notify if @user != Discourse.site_contact_user
|
||||||
if @success
|
if @success
|
||||||
SystemMessage.create(@user, :export_succeeded)
|
SystemMessage.create_from_system_user(@user, :export_succeeded)
|
||||||
else
|
else
|
||||||
SystemMessage.create(@user, :export_failed, logs: @logs.join("\n"))
|
SystemMessage.create_from_system_user(@user, :export_failed, logs: @logs.join("\n"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -284,9 +284,9 @@ module Import
|
||||||
log "Notifying '#{user.username}' of the end of the restore..."
|
log "Notifying '#{user.username}' of the end of the restore..."
|
||||||
# NOTE: will only notify if user != Discourse.site_contact_user
|
# NOTE: will only notify if user != Discourse.site_contact_user
|
||||||
if @success
|
if @success
|
||||||
SystemMessage.create(user, :import_succeeded)
|
SystemMessage.create_from_system_user(user, :import_succeeded)
|
||||||
else
|
else
|
||||||
SystemMessage.create(user, :import_failed, logs: @logs.join("\n"))
|
SystemMessage.create_from_system_user(user, :import_failed, logs: @logs.join("\n"))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log "Could not send notification to '#{@user_info[:username]}' (#{@user_info[:email]}), because the user does not exists..."
|
log "Could not send notification to '#{@user_info[:username]}' (#{@user_info[:email]}), because the user does not exists..."
|
||||||
|
|
Loading…
Reference in New Issue