Email notification failures when files are locked fixed
This commit is contained in:
parent
beb1ef34ba
commit
de9370961a
@ -125,7 +125,7 @@ class DmsfFilesController < ApplicationController
|
|||||||
begin
|
begin
|
||||||
DmsfMailer.files_updated(User.current, [@file]).deliver
|
DmsfMailer.files_updated(User.current, [@file]).deliver
|
||||||
rescue ActionView::MissingTemplate => e
|
rescue ActionView::MissingTemplate => e
|
||||||
Rails.logger.error "Could not send email notifications: " + e
|
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||||
end
|
end
|
||||||
redirect_to :action => "show", :id => @file
|
redirect_to :action => "show", :id => @file
|
||||||
else
|
else
|
||||||
|
|||||||
@ -72,7 +72,7 @@ class DmsfFilesCopyController < ApplicationController
|
|||||||
begin
|
begin
|
||||||
DmsfMailer.files_updated(User.current, [new_file]).deliver
|
DmsfMailer.files_updated(User.current, [new_file]).deliver
|
||||||
rescue ActionView::MissingTemplate => e
|
rescue ActionView::MissingTemplate => e
|
||||||
Rails.logger.error "Could not send email notifications: " + e
|
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to :controller => "dmsf_files", :action => "show", :id => new_file
|
redirect_to :controller => "dmsf_files", :action => "show", :id => new_file
|
||||||
@ -110,7 +110,7 @@ class DmsfFilesCopyController < ApplicationController
|
|||||||
# TODO: implement proper mail notification
|
# TODO: implement proper mail notification
|
||||||
DmsfMailer.files_updated(User.current, [@file]).deliver
|
DmsfMailer.files_updated(User.current, [@file]).deliver
|
||||||
rescue ActionView::MissingTemplate => e
|
rescue ActionView::MissingTemplate => e
|
||||||
Rails.logger.error "Could not send email notifications: " + e
|
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to :controller => "dmsf_files", :action => "show", :id => @file
|
redirect_to :controller => "dmsf_files", :action => "show", :id => @file
|
||||||
|
|||||||
@ -125,7 +125,7 @@ class DmsfFile < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def title
|
def title
|
||||||
self.last_revision.title
|
self.last_revision ? self.last_revision.title : self.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
@ -150,10 +150,8 @@ class DmsfFile < ActiveRecord::Base
|
|||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
def dmsf_path_str
|
def dmsf_path_str
|
||||||
path = self.dmsf_path
|
self.dmsf_path.map { |element| element.title }.join('/')
|
||||||
string_path = path.map { |element| element.title }
|
|
||||||
string_path.join("/")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify?
|
def notify?
|
||||||
|
|||||||
@ -8,9 +8,10 @@
|
|||||||
deleted DMSF files in project <%= @project.name %>:
|
deleted DMSF files in project <%= @project.name %>:
|
||||||
<% @files.each do |file| %>
|
<% @files.each do |file| %>
|
||||||
<p>
|
<p>
|
||||||
<%= h(file.dmsf_path_str) %> (<%= file.name %>),
|
<%= h(file.dmsf_path_str) %> (<%= file.name %>)
|
||||||
<%= number_to_human_size(file.last_revision.size) %>,
|
<% if file.last_revision %>
|
||||||
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
|
, <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
|
||||||
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
User <%= @user %> deleted DMSF files in project <%= @project.name %>:
|
User <%= @user %> deleted DMSF files in project <%= @project.name %>:
|
||||||
<% @files.each do |file| %>
|
<% @files.each do |file| %>
|
||||||
<%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
|
<%= file.dmsf_path_str %> (<%= file.name %>)
|
||||||
|
<% if file.last_revision %>
|
||||||
|
, <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %>
|
|
||||||
deleted DMSF files in project <%= @project.name %>:
|
|
||||||
<% @files.each do |file| %>
|
|
||||||
<p>
|
|
||||||
<%= h(file.dmsf_path_str) %> (<%= file.name %>),
|
|
||||||
<%= number_to_human_size(file.last_revision.size) %>,
|
|
||||||
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
|
|
||||||
</p>
|
|
||||||
<% end %>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
User <%= @user %> deleted DMSF files in project <%= @project.name %>:
|
|
||||||
<% @files.each do |file| %>
|
|
||||||
<%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user