From 15397d3f2decfe6e5970fc176ef04ad0d32485f4 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Tue, 27 Mar 2018 12:47:54 -0300
Subject: [PATCH] Bug 20479: Use  instead of fetching patron

---
 C4/Auth.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/C4/Auth.pm b/C4/Auth.pm
index 362f9f96cc..18a7d7fef5 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -204,7 +204,8 @@ sub get_template_and_user {
                 $in->{template_name} =~ m|sco/| && haspermission(
                     $user, { self_check => 'self_checkout_module' }
                 )
-            ) && Koha::Patrons->find({userid=>$user}) && Koha::Patrons->find({userid=>$user})->flags != 1
+            )
+            && $flags && $flags->{superlibrarian} != 1
           )
         {
             $kick_out = 1;
-- 
2.11.0