From: Bill Erickson Date: Tue, 6 Aug 2013 14:10:19 +0000 (-0400) Subject: LP1207396 user stage allows username selection X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4a3a7193dbe5388b5672f29108c59dedeee65cc4;p=evergreen%2Fmasslnc.git LP1207396 user stage allows username selection The caller may now pass a value for username. If unset, it still falls back to using a uuid. If the username clashes with an existing staged username, a USERNAME_EXISTS event is returned. Signed-off-by: Bill Erickson Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Stage.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Stage.pm index ff608791c8..8f094b7204 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Stage.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Stage.pm @@ -38,9 +38,13 @@ sub create_user_stage { my $e = new_editor(xact => 1); - my $uname = $U->create_uuid_string; + my $uname = $user->usrname || $U->create_uuid_string; $user->usrname($uname); + # see if this username is already taken + return OpenILS::Event->new('USERNAME_EXISTS') if + $e->search_staging_user_stage({usrname => $uname})->[0]; + $e->create_staging_user_stage($user) or return $e->die_event; if($mail_addr) {