Bug 27330: Return 403 if club has no enrollments
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 4 Jan 2021 14:24:51 +0000 (11:24 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 25 Feb 2021 08:57:05 +0000 (09:57 +0100)
commit4f3d15c8d2e470e7e1f1175879a95d0b9e53a5c7
tree9059f4d673c86d3a271baf2ad07e80f56f5b540f
parentf48b9b7611bba2ac6b76c7c1336cae72057bdbfb
Bug 27330: Return 403 if club has no enrollments

This patch makes the controller script return a 403 as it should [1]
instead of a plain 500.

To test:
1. Apply the regressions tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/clubs_holds.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

[1] https://www.restapitutorial.com/httpstatuscodes.html

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ea0696831fadd4b633c90fc7ccd29144e9a6b87a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/REST/V1/Clubs/Holds.pm