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
|
||||
DmsfMailer.files_updated(User.current, [@file]).deliver
|
||||
rescue ActionView::MissingTemplate => e
|
||||
Rails.logger.error "Could not send email notifications: " + e
|
||||
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||
end
|
||||
redirect_to :action => "show", :id => @file
|
||||
else
|
||||
|
||||
@ -72,7 +72,7 @@ class DmsfFilesCopyController < ApplicationController
|
||||
begin
|
||||
DmsfMailer.files_updated(User.current, [new_file]).deliver
|
||||
rescue ActionView::MissingTemplate => e
|
||||
Rails.logger.error "Could not send email notifications: " + e
|
||||
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||
end
|
||||
|
||||
redirect_to :controller => "dmsf_files", :action => "show", :id => new_file
|
||||
@ -110,7 +110,7 @@ class DmsfFilesCopyController < ApplicationController
|
||||
# TODO: implement proper mail notification
|
||||
DmsfMailer.files_updated(User.current, [@file]).deliver
|
||||
rescue ActionView::MissingTemplate => e
|
||||
Rails.logger.error "Could not send email notifications: " + e
|
||||
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||
end
|
||||
|
||||
redirect_to :controller => "dmsf_files", :action => "show", :id => @file
|
||||
|
||||
@ -125,7 +125,7 @@ class DmsfFile < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def title
|
||||
self.last_revision.title
|
||||
self.last_revision ? self.last_revision.title : self.name
|
||||
end
|
||||
|
||||
def description
|
||||
@ -150,10 +150,8 @@ class DmsfFile < ActiveRecord::Base
|
||||
path
|
||||
end
|
||||
|
||||
def dmsf_path_str
|
||||
path = self.dmsf_path
|
||||
string_path = path.map { |element| element.title }
|
||||
string_path.join("/")
|
||||
def dmsf_path_str
|
||||
self.dmsf_path.map { |element| element.title }.join('/')
|
||||
end
|
||||
|
||||
def notify?
|
||||
|
||||
@ -8,9 +8,10 @@
|
||||
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 %>
|
||||
<%= h(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 %>
|
||||
</p>
|
||||
<% end %>
|
||||
</body>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
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 %>
|
||||
|
||||
<%= 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 %>
|
||||
@ -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