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
This commit is contained in:
Jean-Philippe Lang 2008-11-13 16:43:39 +00:00
parent 243027e63a
commit 7c1d8ac00b
1 changed files with 5 additions and 1 deletions

View File

@ -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?