From 7c1d8ac00b62e63045f667c2897730fd9e1657a1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 13 Nov 2008 16:43:39 +0000 Subject: [PATCH] Fixes #2170: user display format in application settings broken by r2010. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2031 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 53453c0dc..72c550b82 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -125,7 +125,11 @@ class User < ActiveRecord::Base # Return user's full name for display def name(formatter = nil) - @name ||= eval('"' + (USER_FORMATS[formatter || Setting.user_format] || USER_FORMATS[:firstname_lastname]) + '"') + if formatter + eval('"' + (USER_FORMATS[formatter] || USER_FORMATS[:firstname_lastname]) + '"') + else + @name ||= eval('"' + (USER_FORMATS[Setting.user_format] || USER_FORMATS[:firstname_lastname]) + '"') + end end def active? -- 2.39.5