From 6db0e5fd8753d131bd7c88c0721d9d962a28cc1a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 13 Apr 2016 09:32:49 +0200 Subject: [PATCH] Reset UserInfo.current_user_id to 1 if no user is authenticated. --- app/controllers/application_controller.rb | 5 ++++- app/models/user.rb | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5b83ce553..078c7fa7d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -73,7 +73,10 @@ class ApplicationController < ActionController::Base # Sets the current user into a named Thread location so that it can be accessed # by models and observers def set_user - return if !current_user + if !current_user + UserInfo.current_user_id = 1 + return + end UserInfo.current_user_id = current_user.id end diff --git a/app/models/user.rb b/app/models/user.rb index 0afb1e4aa..013bc1888 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -417,9 +417,6 @@ returns # reset login failed self.login_failed = 0 - # set updated by user - self.updated_by_id = id - save end