Bug 28973: Improve Koha::Patron::can_see_patron_infos efficiency
The method can_see_patron_infos looks up a row in the branches table by branchcode just to get the branchcode it already has. This seems inefficient. Test Plan: 1) Apply this patch 2) No changes should be noted Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
2f4d5954c9
commit
e44b4837f5
|
|
@ -1335,7 +1335,7 @@ Return true if the patron (usually the logged in user) can see the patron's info
|
|||
sub can_see_patron_infos {
|
||||
my ( $self, $patron ) = @_;
|
||||
return unless $patron;
|
||||
return $self->can_see_patrons_from( $patron->library->branchcode );
|
||||
return $self->can_see_patrons_from( $patron->branchcode );
|
||||
}
|
||||
|
||||
=head3 can_see_patrons_from
|
||||
|
|
|
|||
Loading…
Reference in New Issue