Bugzilla – Attachment 94552 Details for
Bug 18795
REST API: DELETE (anonymize) checkout history
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18795: (follow-up) Check whether patrons exists before deleting history
0001-Bug-18795-follow-up-Check-whether-patrons-exists-bef.patch (text/plain), 1.27 KB, created by
Johanna Räisä
on 2019-10-22 13:14:48 UTC
(
hide
)
Description:
Bug 18795: (follow-up) Check whether patrons exists before deleting history
Filename:
MIME Type:
Creator:
Johanna Räisä
Created:
2019-10-22 13:14:48 UTC
Size:
1.27 KB
patch
obsolete
>From 4b3087b9ba685042bb0524fd99b027afe9746218 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Tue, 22 Oct 2019 12:39:35 +0000 >Subject: [PATCH 1/2] Bug 18795: (follow-up) Check whether patrons exists > before deleting history > >Running $patrons->anonymise_issue_history after checking patrons >exists is more logical even though $patrons->anonymise_issue_history() >can handle 0 patrons returned in the search. Also this way we don't >have to run anonymise_issue_history() code unless needed, thus making >the code finish faster. > >Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com> >--- > Koha/REST/V1/Checkouts.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm >index ba3c615a2a..887714d22c 100644 >--- a/Koha/REST/V1/Checkouts.pm >+++ b/Koha/REST/V1/Checkouts.pm >@@ -197,14 +197,14 @@ sub delete_history { > 'me.borrowernumber' => $patron_id > }); > >- $patrons->anonymise_issue_history; >- > unless ($patrons->count) { > return $c->render( status => 404, openapi => { > error => "Patron doesn't exist" > }); > } > >+ $patrons->anonymise_issue_history; >+ > return $c->render( status => 204, openapi => "" ); > } > >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18795
:
64255
|
94533
|
94547
|
94548
|
94549
|
94552
|
94555
|
95246
|
95247
|
95248
|
95265
|
95266
|
95267
|
95463
|
95464
|
95465