Actually use user_block
authorSimon Poole <simon@poole.ch>
Sat, 18 Feb 2017 15:17:46 +0000 (16:17 +0100)
committerSimon Poole <simon@poole.ch>
Sat, 18 Feb 2017 15:17:46 +0000 (16:17 +0100)
app/controllers/application_controller.rb

index 8a27a2f..d6516dc 100644 (file)
@@ -155,7 +155,7 @@ class ApplicationController < ActionController::Base
       user_block =  @user.blocks.active.take
       unless user_block.nil? 
         set_locale
-        if  @user.blocks.active.take.zero_hour?
+        if  user_block.zero_hour?
           report_error  t("application.setup_user_auth.blocked_zero_hour"), :forbidden
         else
           report_error t("application.setup_user_auth.blocked"), :forbidden