LP1950826 fix invalidate email action
authorJason Etheridge <jason@EquinoxOLI.org>
Mon, 15 Nov 2021 22:30:17 +0000 (17:30 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 7 Apr 2022 14:46:48 +0000 (10:46 -0400)
and other invalidate contact actions

Signed-off-by: Jason Etheridge <jason@EquinoxOLI.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/BadContact.pm

index 28ee239..c8972a3 100644 (file)
@@ -98,10 +98,15 @@ sub mark_users_contact_invalid {
         $usr_penalty->org_unit($penalty_ou);
         $usr_penalty->standing_penalty($penalty->id);
         $usr_penalty->staff($staff_id);
-        $usr_penalty->note($_->$contact_type);
 
-        $editor->create_actor_user_standing_penalty($usr_penalty) or
-            return $editor->die_event;
+        my ($result) = $U->simplereq('open-ils.actor', 'open-ils.actor.user.penalty.apply',
+            $editor->authtoken,
+            $usr_penalty,
+            { message => $_->$contact_type }
+        );
+
+        # FIXME: this perpetuates a bug; the patron editor UI doesn't handle these error states well
+        return $editor->die_event if $result && ref $result eq 'HASH';
 
         $_->$clear_meth;
         $editor->update_actor_user($_) or return $editor->die_event;