From c0bc71f0846ee07f9acd469763549ac5f643fe27 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 10 Jun 2013 14:21:33 -0400 Subject: [PATCH] fix current_user in model --- apps/workbench/app/controllers/application_controller.rb | 2 +- apps/workbench/app/models/arvados_base.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 81a1075b36..b65b00aae9 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -93,7 +93,7 @@ class ApplicationController < ActionController::Base def current_user if Thread.current[:arvados_api_token] - @current_user ||= User.current + Thread.current[:user] ||= User.current else logger.error "No API token in Thread" return nil diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb index 172c91d4bc..cb4463a9be 100644 --- a/apps/workbench/app/models/arvados_base.rb +++ b/apps/workbench/app/models/arvados_base.rb @@ -258,6 +258,7 @@ class ArvadosBase < ActiveRecord::Base end def current_user + Thread.current[:user] ||= User.current if Thread.current[:arvados_api_token] Thread.current[:user] end end -- 2.30.2