Bug 36937: Remove warning from unit tests
This patch fixes a warning in the unit tests Test plan: 1) prove t/db_dependent/api/v1/password_validation.t 2) There will be a warning in the output - 'Use of uninitialized value $status in numeric eq (==)' 3) Apply patch 4) Re-run the test 5) The warning will disappear Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
parent
ec8465eb10
commit
0af87f009f
|
|
@ -73,7 +73,7 @@ sub validate {
|
|||
return try {
|
||||
my ( $status, $THE_cardnumber, $THE_userid, $patron ) = C4::Auth::checkpw( $identifier, $password );
|
||||
unless ( $status && $status > 0 ) {
|
||||
my $error_response = $status == -2 ? 'Password expired' : 'Validation failed';
|
||||
my $error_response = ($status && $status == -2) ? 'Password expired' : 'Validation failed';
|
||||
return $c->render(
|
||||
status => 400,
|
||||
openapi => { error => $error_response }
|
||||
|
|
|
|||
Loading…
Reference in New Issue