ignore expired penalties
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 9 Jun 2009 17:08:11 +0000 (17:08 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 9 Jun 2009 17:08:11 +0000 (17:08 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13351 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Utils/Penalty.pm

index 2c25ac6..596a016 100644 (file)
@@ -70,7 +70,14 @@ sub retrieve_penalties {
     my($class, $e, $user_id, $context_org, @fatal_mask) = @_;
 
     my $penalties = $e->search_actor_user_standing_penalty([
-        {usr => $user_id, org_unit => $U->get_org_ancestors($context_org)},
+        {
+            usr => $user_id, 
+            org_unit => $U->get_org_ancestors($context_org),
+            '-or' => [
+                {stop_date => undef},
+                {stop_date => {'>' => 'now'}}
+            ],
+        },
         {flesh => 1, flesh_fields => {ausp => ['standing_penalty']}}
     ]);