fixes for failed cron maintenance tasks

* update rails scripts for 5.2
* system dmails should be scoped to system
* fix broken url generator in forum notices
This commit is contained in:
Albert Yi
2018-04-27 14:44:43 -07:00
parent 907881aced
commit 664a3f02e2
16 changed files with 139 additions and 46 deletions

View File

@@ -110,9 +110,11 @@ class Dmail < ApplicationRecord
end
def create_automated(params)
dmail = Dmail.new(from: User.system, **params)
dmail.owner = dmail.to
dmail.save
CurrentUser.as_system do
dmail = Dmail.new(from: User.system, **params)
dmail.owner = dmail.to
dmail.save
end
dmail
end
end

View File

@@ -10,4 +10,4 @@
<br>
<% end %>
<p><%= link_to "View topic", forum_topic_path(@forum_topic, :page => @forum_topic.last_page, :host => Danbooru.config.hostname, :only_path => false) %> | <%= link_to "Unsubscribe", maintenance_user_email_notification_url(:user_id => @user.id, :sig => email_sig(@user), :host => Danbooru.config.hostname, :only_path => false) %></p>
<p><%= link_to "View topic", forum_topic_url(@forum_topic, :page => @forum_topic.last_page, :host => Danbooru.config.hostname, :only_path => false) %> | <%= link_to "Unsubscribe", maintenance_user_email_notification_url(:user_id => @user.id, :sig => email_sig(@user), :host => Danbooru.config.hostname, :only_path => false) %></p>