fix not shown ban reason

This commit is contained in:
pixeldesu 2015-05-05 18:09:26 +02:00
parent 9b39491d88
commit 42b41a268b
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception. # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead. # For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller? before_filter :configure_permitted_parameters, if: :devise_controller?
before_filter :banned? before_filter :banned?
@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base
name = current_user.screen_name name = current_user.screen_name
# obligatory '2001: A Space Odyssey' reference # obligatory '2001: A Space Odyssey' reference
flash[:notice] = "I'm sorry, #{name}, I'm afraid I can't do that." flash[:notice] = "I'm sorry, #{name}, I'm afraid I can't do that."
if current_user.ban_reason.nil? unless current_user.ban_reason.nil?
flash[:notice] += "\nBan reason: #{current_user.ban_reason}" flash[:notice] += "\nBan reason: #{current_user.ban_reason}"
end end
if not current_user.permanently_banned? if not current_user.permanently_banned?