From 448aec3fc902b609659ea4f91bc312757263ab27 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 11 Oct 2023 14:00:08 +0000 Subject: [PATCH] Bug 25393: (QA follow-up) simplify auto_renew condition _CanBookBeAutoRenewed will only ever return 'auto_too_soon' not 'too_soon' so we can do a simple equality check Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 3639596910..b415674cb2 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3103,15 +3103,15 @@ sub CanBookBeRenewed { } } - if($auto_renew =~ 'too_soon'){ + if ( $auto_renew eq 'auto_too_soon' ) { # If its cron, tell it it's too soon for a an auto renewal return ( 0, $auto_renew, { soonest_renew_date => $soonest } ) if $cron; # Check if it's too soon for a manual renewal my $soonestManual = GetSoonestRenewDate( $patron, $issue ); - if($soonestManual > dt_from_string()){ - return (0, "too_soon", { soonest_renew_date => $soonestManual } ) unless $override_limit; + if ( $soonestManual > dt_from_string() ) { + return ( 0, "too_soon", { soonest_renew_date => $soonestManual } ) unless $override_limit; } } -- 2.39.5