Ergebnis von SL::DB::Manager::Employee->current cachen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 13 Feb 2019 10:45:58 +0000 (11:45 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 13 Feb 2019 16:40:21 +0000 (17:40 +0100)
SL/DB/Manager/Employee.pm

index a8c690a..f9642ab 100644 (file)
@@ -22,7 +22,7 @@ sub _sort_spec {
 
 sub current {
   return undef unless $::myconfig{login};
-  return shift->find_by(login => $::myconfig{login});
+  return $::request->cache('current')->{object} //= shift->find_by(login => $::myconfig{login});
 }
 
 sub update_entries_for_authorized_users {