[open-ils-commits] r11319 - trunk/Open-ILS/src/perlmods/OpenILS/Utils
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 24 10:13:22 EST 2008
Author: erickson
Date: 2008-11-24 10:13:15 -0500 (Mon, 24 Nov 2008)
New Revision: 11319
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Utils/Penalty.pm
Log:
we delete objects, not IDs, so object-ify the penalty for delete
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/Penalty.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/Penalty.pm 2008-11-24 15:12:44 UTC (rev 11318)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/Penalty.pm 2008-11-24 15:13:15 UTC (rev 11319)
@@ -26,15 +26,14 @@
$_->{standing_penalty} == $pen_obj->{standing_penalty} and
($_->{id} || '') ne ($pen_obj->{id} || '') } @$penalties;
+ my $pen = Fieldmapper::actor::user_standing_penalty->new;
+ $pen->$_($pen_obj->{$_}) for keys %$pen_obj;
+
if(defined $pen_obj->{id}) {
- $e->delete_actor_user_standing_penalty($pen_obj->{id})
- or return $e->die_event;
+ $e->delete_actor_user_standing_penalty($pen) or return $e->die_event;
} else {
- my $newp = Fieldmapper::actor::user_standing_penalty->new;
- $newp->$_($pen_obj->{$_}) for keys %$pen_obj;
- $e->create_actor_user_standing_penalty($newp)
- or return $e->die_event;
+ $e->create_actor_user_standing_penalty($pen) or return $e->die_event;
}
}
More information about the open-ils-commits
mailing list