]> source.dussan.org Git - redmine.git/commitdiff
Fixes #2170: user display format in application settings broken by r2010.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 13 Nov 2008 16:43:39 +0000 (16:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 13 Nov 2008 16:43:39 +0000 (16:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2031 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index 53453c0dc824abc6dfec451b0ad1ee154ba2fd12..72c550b822745793c4875d42814bdc8b728b6759 100644 (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?