[open-ils-commits] r8767 -
trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Feb 18 17:25:25 EST 2008
Author: erickson
Date: 2008-02-18 16:55:14 -0500 (Mon, 18 Feb 2008)
New Revision: 8767
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
returning undef on not-found instead of 0 to prevent id=0 conflicts
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-02-18 21:41:14 UTC (rev 8766)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-02-18 21:55:14 UTC (rev 8767)
@@ -2615,15 +2615,13 @@
/
);
-# XXX Make me retun undef if no user has the ID
-
sub usrname_exists {
my( $self, $conn, $auth, $usrname ) = @_;
my $e = new_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
my $a = $e->search_actor_user({usrname => $usrname, deleted=>'f'}, {idlist=>1});
return $$a[0] if $a and @$a;
- return 0;
+ return undef;
}
__PACKAGE__->register_method(
@@ -2639,7 +2637,7 @@
my $e = new_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
my $card = $e->search_actor_card({barcode => $barcode});
- return 0 unless @$card;
+ return undef unless @$card;
return $card->[0]->usr;
}
More information about the open-ils-commits
mailing list