be more strict about going away after short-circut code; check earlier for hold validity
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 29 May 2009 18:05:29 +0000 (18:05 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 29 May 2009 18:05:29 +0000 (18:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13262 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm

index 8a94957..5b178ce 100644 (file)
@@ -884,6 +884,8 @@ sub new_hold_copy_targeter {
                        $hold->remove_from_object_index();
                        $hold = action::hold_request->retrieve( $hold->id );
 
+                       die "OK\n" if (!$hold or $hold->capture_time or $hold->cancel_time);
+
                        # remove old auto-targeting maps
                        my @oldmaps = action::hold_copy_map->search( hold => $hold->id );
                        $_->delete for (@oldmaps);
@@ -892,10 +894,9 @@ sub new_hold_copy_targeter {
                                my $ex_time = $parser->parse_datetime( clense_ISO8601( $hold->expire_time ) );
                                $hold->update( { cancel_cause => 1, cancel_time => 'now' } ) if ( DateTime->compare($ex_time, DateTime->now) < 0 );
                                $self->method_lookup('open-ils.storage.transaction.commit')->run;
+                               die "OK\n";
                        }
 
-                       die "OK\n" if (!$hold or $hold->capture_time or $hold->cancel_time);
-
                        my $all_copies = [];
 
                        # find filters for MR holds