LP#1804038 Fix-ups for older 'clense' functions
authorDan Wells <dbw2@calvin.edu>
Tue, 20 Nov 2018 17:33:49 +0000 (12:33 -0500)
committerDan Wells <dbw2@calvin.edu>
Tue, 20 Nov 2018 18:42:03 +0000 (13:42 -0500)
Way back when, we switched from a misspelled 'clense_ISO8601' to a
corrected 'cleanse_ISO8601' in OpenSRF.  This function has again moved,
and is now part of OpenILS::Utils::DateTime, and is named
'clean_ISO8601'.  This was done as part of LP bug #1552778.

However, a few stragglers of the misspelling remained, so these were
missed when the big changeover occurred.  This hopefully catches them
all!

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Jason Boyer <jboyer@library.in.gov>

Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Booking.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm

index 31e7083..c2b701a 100644 (file)
@@ -4064,7 +4064,7 @@ sub _reset_password_request {
 
     # Guard against no active requests
     if ($active_requests->[0]->{'request_time'}) {
-        my $last_request = DateTime::Format::ISO8601->parse_datetime(clense_ISO8601($active_requests->[0]->{'request_time'}));
+        my $last_request = DateTime::Format::ISO8601->parse_datetime(clean_ISO8601($active_requests->[0]->{'request_time'}));
         my $now = DateTime::Format::ISO8601->new();
 
         # 3. if (num_active > throttle_threshold) and (now - last_request < 1 minute)
@@ -4171,7 +4171,7 @@ sub commit_password_reset {
 
     # Ensure we're still within the TTL for the request
     my $aupr_ttl = $U->ou_ancestor_setting_value($user->home_ou, 'circ.password_reset_request_time_to_live') || 24*60*60;
-    my $threshold = DateTime::Format::ISO8601->parse_datetime(clense_ISO8601($aupr->[0]->request_time))->add(seconds => $aupr_ttl);
+    my $threshold = DateTime::Format::ISO8601->parse_datetime(clean_ISO8601($aupr->[0]->request_time))->add(seconds => $aupr_ttl);
     if ($threshold < DateTime->now(time_zone => 'local')) {
         $e->die_event;
         $logger->info("Password reset request needed to be submitted before $threshold");
index d7ea212..09680b8 100644 (file)
@@ -830,7 +830,7 @@ sub could_capture {
                 $client->respond($bresv);
             } else {
                 my $start_time = $dt_parser->parse_datetime(
-                    clense_ISO8601($bresv->start_time)
+                    clean_ISO8601($bresv->start_time)
                 );
 
                 if ($now >= $start_time->subtract("seconds" => $elbow_room)) {
index fe509e9..d41c688 100644 (file)
@@ -77,7 +77,7 @@ sub _cleanse_dates {
     my $fields = shift;
 
     foreach my $field (@$fields) {
-        $item->$field(OpenSRF::Utils::clense_ISO8601($item->$field)) if $item->$field;
+        $item->$field(clean_ISO8601($item->$field)) if $item->$field;
     }
     return 0;
 }