From 10f14136f570863c2898f429c936de6c0114206a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 13 Mar 2013 23:45:47 +0200 Subject: [PATCH] fix setting gon.api_token --- app/controllers/application_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 69d23477493..bb1afc80771 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -152,7 +152,9 @@ class ApplicationController < ActionController::Base def add_gon_variables gon.default_issues_tracker = Project.issues_tracker.default_value - gon.api_token = current_user.private_token - gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url + if current_user + gon.api_token = current_user.private_token + gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url + end end end