[Koha-bugs] [Bug 29741] Add Koha::Patron->safe_to_delete

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Dec 21 01:37:08 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29741

David Nind <david at davidnind.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #128784|0                           |1
        is obsolete|                            |

--- Comment #9 from David Nind <david at davidnind.com> ---
Created attachment 128816
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128816&action=edit
Bug 29741: (follow-up) Make DELETE /patrons use the new validation method

This patch adapts the route so it uses the newly introduced
Koha::Patron->safe_to_delete method.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Note: There's a trivial behavior change, in which the 'anonymous patron'
use case is caugh eariler than the ->delete call. I left the exception
catch block just in case, who knows :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

Signed-off-by: David Nind <david at davidnind.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list