[open-ils-commits] r16044 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 29 16:36:17 EDT 2010
Author: phasefx
Date: 2010-03-29 16:36:12 -0400 (Mon, 29 Mar 2010)
New Revision: 16044
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
Log:
the reason I wanted to pass in an editor here, so I could flesh the users for their home_ou's needed for the event
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-03-29 20:36:10 UTC (rev 16043)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-03-29 20:36:12 UTC (rev 16044)
@@ -2717,8 +2717,15 @@
my $ses = OpenSRF::AppSession->create('open-ils.trigger');
$ses->connect;
+ my %cached_usr_home_ou = ();
for my $user_req (@$user_reqs) {
- my $req = $ses->request('open-ils.trigger.event.autocreate', $hook, $user_req, $user_req->usr->home_ou);
+ my $home_ou = $cached_usr_home_ou{$user_req->usr};
+ if (! $home_ou) {
+ my $user = $e->retrieve_actor_user($user_req->usr) or return $e->die_event;
+ $home_ou = $user->home_ou;
+ $cached_usr_home_ou{$user_req->usr} = $home_ou;
+ }
+ my $req = $ses->request('open-ils.trigger.event.autocreate', $hook, $user_req, $home_ou);
$req->recv;
}
More information about the open-ils-commits
mailing list