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 <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
d67ab23373
commit
448aec3fc9
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue