From 5e2e374c72f75d71c63c78a57edddde895b37e2a Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Thu, 30 Jul 2020 13:10:16 +0300 Subject: [PATCH] DEV: Fix build Follow-up to bd3c0dd59f9034688d3ab70ff2317d4b910e9513. --- app/controllers/application_controller.rb | 4 +++- app/views/exceptions/not_found.html.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 87c3ba014e3..4bf4934c7a6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -785,7 +785,9 @@ class ApplicationController < ActionController::Base opts[:layout] = 'application' if opts[:layout] == 'no_ember' end - if !SiteSetting.login_required? || (current_user rescue false) + @current_user = current_user rescue nil + + if !SiteSetting.login_required? || @current_user key = "page_not_found_topics" if @topics_partial = Discourse.redis.get(key) @topics_partial = @topics_partial.html_safe diff --git a/app/views/exceptions/not_found.html.erb b/app/views/exceptions/not_found.html.erb index 6975dbfe725..72d607a87e4 100644 --- a/app/views/exceptions/not_found.html.erb +++ b/app/views/exceptions/not_found.html.erb @@ -1,7 +1,7 @@

<%= @title %>

- <%- if !current_user %> + <%- if !@current_user %> " class='btn btn-primary'><%= SvgSprite.raw_svg('fa-user') %><%= I18n.t('log_in') %> <%- end %>