[Bps-public-commit] r16873 - sd/trunk/lib/App/SD/Replica

ruz at bestpractical.com ruz at bestpractical.com
Mon Nov 17 11:42:34 EST 2008


Author: ruz
Date: Mon Nov 17 11:42:34 2008
New Revision: 16873

Modified:
   sd/trunk/lib/App/SD/Replica/hm.pm

Log:
* apply default search conditions only when uri has no conditions

Modified: sd/trunk/lib/App/SD/Replica/hm.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/hm.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/hm.pm	Mon Nov 17 11:42:34 2008
@@ -93,16 +93,21 @@
 
 sub find_matching_tasks {
     my $self = shift;
-    my %args = (
-        owner        => 'me',
-        group        => 0,
-        requestor    => 'me',
-        not_complete => 1,
-    );
+    my %args = ();
 
     if ( my $props = $self->props ) {
         while ( my ($k, $v) = each %$props ) { $args{$k} = $v }
     }
+
+    unless ( keys %args ) {
+        %args = (
+            owner        => 'me',
+            group        => 0,
+            requestor    => 'me',
+            not_complete => 1,
+        );
+    }
+
     my $status = $self->hm->act( 'TaskSearch', %args );
     unless ( $status->{'success'} ) {
         die "couldn't search";



More information about the Bps-public-commit mailing list