##// END OF EJS Templates
Makes User.current thread safe (#12097)....
Jean-Philippe Lang -
r10684:9507b448b258
parent child
Show More
@@ -601,11 +601,11 class User < Principal
601 end
601 end
602
602
603 def self.current=(user)
603 def self.current=(user)
604 @current_user = user
604 Thread.current[:current_user] = user
605 end
605 end
606
606
607 def self.current
607 def self.current
608 @current_user ||= User.anonymous
608 Thread.current[:current_user] ||= User.anonymous
609 end
609 end
610
610
611 # Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
611 # Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
General Comments 0
You need to be logged in to leave comments. Login now