Bugzilla – Attachment 116113 Details for
Bug 27330
Wrong return status when no enrollments in club holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27330: (QA follow-up) Return 409 instead
Bug-27330-QA-follow-up-Return-409-instead.patch (text/plain), 2.36 KB, created by
Katrin Fischer
on 2021-01-31 14:06:58 UTC
(
hide
)
Description:
Bug 27330: (QA follow-up) Return 409 instead
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-01-31 14:06:58 UTC
Size:
2.36 KB
patch
obsolete
>From 32135fb652d9e21abcef3b2061f4805153d70514 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 27 Jan 2021 07:37:05 -0300 >Subject: [PATCH] Bug 27330: (QA follow-up) Return 409 instead > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/REST/V1/Clubs/Holds.pm | 2 +- > api/v1/swagger/paths/clubs.json | 8 +++++++- > t/db_dependent/api/v1/clubs_holds.t | 2 +- > 3 files changed, 9 insertions(+), 3 deletions(-) > >diff --git a/Koha/REST/V1/Clubs/Holds.pm b/Koha/REST/V1/Clubs/Holds.pm >index 67b7fdbbdc..21c95c1d15 100644 >--- a/Koha/REST/V1/Clubs/Holds.pm >+++ b/Koha/REST/V1/Clubs/Holds.pm >@@ -132,7 +132,7 @@ sub add { > if ( blessed $_ ) { > if ($_->isa('Koha::Exceptions::ClubHold::NoPatrons')) { > return $c->render( >- status => 403, >+ status => 409, > openapi => { error => $_->description } > ); > } >diff --git a/api/v1/swagger/paths/clubs.json b/api/v1/swagger/paths/clubs.json >index fb66e4107f..3da704f3eb 100644 >--- a/api/v1/swagger/paths/clubs.json >+++ b/api/v1/swagger/paths/clubs.json >@@ -81,6 +81,12 @@ > "$ref": "../definitions.json#/error" > } > }, >+ "409": { >+ "description": "Hold not allowed", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, > "500": { > "description": "Internal server error", > "schema": { >@@ -101,4 +107,4 @@ > } > } > } >-} >\ No newline at end of file >+} >diff --git a/t/db_dependent/api/v1/clubs_holds.t b/t/db_dependent/api/v1/clubs_holds.t >index 0f8ca8ef1f..e6cfde9729 100755 >--- a/t/db_dependent/api/v1/clubs_holds.t >+++ b/t/db_dependent/api/v1/clubs_holds.t >@@ -86,7 +86,7 @@ subtest 'add() tests' => sub { > $t->post_ok( "//$userid:$password@/api/v1/clubs/" > . $club_without_enrollments->id > . "/holds" => json => $data ) >- ->status_is(403) >+ ->status_is(409) > ->json_is( '/error' => "Cannot place a hold on a club without patrons." ); > > $t->post_ok( "//$userid:$password@/api/v1/clubs/" >-- >2.11.0
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 27330
:
114798
|
114799
|
114800
|
115863
|
115864
|
115865
|
115866
|
115867
|
115968
|
115969
|
115970
|
115971
|
115972
|
116109
|
116110
|
116111
|
116112
| 116113