Skip to content

Commit

Permalink
OpsController: don't translate audit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mzazrivec committed Nov 21, 2018
1 parent 88cd254 commit 40a5361
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/controllers/ops_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -784,31 +784,31 @@ def replace_explorer_trees(replace_trees, presenter)
def build_saved_audit(record, add = false)
name = record.respond_to?(:name) ? record.name : record.description
msg = if add
_("[%{name}] Record added (") % {:name => name}
"[%{name}] Record added (" % {:name => name}
else
_("[%{name}] Record updated (") % {:name => name}
"[%{name}] Record updated (" % {:name => name}
end
event = "#{record.class.to_s.downcase}_record_#{add ? "add" : "update"}"
i = 0
@edit[:new].each_key do |k|
if @edit[:new][k] != @edit[:current][k]
if k.to_s.ends_with?("password2", "verify") # do nothing
elsif k.to_s.ends_with?("password", "_pwd") # Asterisk out password fields
msg = _("%{message} %{key}:[*] to [*]") % {:message => msg, :key => k.to_s}
msg = "%{message} %{key}:[*] to [*]" % {:message => msg, :key => k.to_s}
else
msg += ", " if i > 0
i += 1
if k == :members
msg = _("%{message} %{key}:[%{old_value}] to [new_value]") %
msg = "%{message} %{key}:[%{old_value}] to [new_value]" %
{:message => msg,
:key => k.to_s,
:old_value => @edit[:current][k].keys.join(","),
:new_value => @edit[:new][k].keys.join(",")}
else
msg = _("%{message} %{key}:[%{old_value}] to [%{new_value}]") % {:message => msg,
:key => k.to_s,
:old_value => @edit[:current][k].to_s,
:new_value => @edit[:new][k].to_s}
msg = "%{message} %{key}:[%{old_value}] to [%{new_value}]" % {:message => msg,
:key => k.to_s,
:old_value => @edit[:current][k].to_s,
:new_value => @edit[:new][k].to_s}
end
end
end
Expand Down

0 comments on commit 40a5361

Please sign in to comment.